Closed Ccaomei closed 2 years ago
@n8bot hi,What are the units of polygon coordinates?Do you have documentation for information about units。thanks !
To be honest, I have no more information. I've never needed to change the honeycomb. I assume the coordinates are in mm, but they may be scaled mm, which would be x/0.000001, or a million times larger.
To be honest, I have no more information. I've never needed to change the honeycomb. I assume the coordinates are in mm, but they may be scaled mm, which would be x/0.000001, or a million times larger.
@n8bot , hi , In the demo, I set spacing and density, but the density of the filling graph is not the specified density. Can you explain the relationship between spacing and density and the offset of the filling graph?
To be honest, I have no more information. I've never needed to change the honeycomb. I assume the coordinates are in mm, but they may be scaled mm, which would be x/0.000001, or a million times larger.
@n8bot , hi , In the demo, I set spacing and density, but the density of the filling graph is not the specified density. Can you explain the relationship between spacing and density and the offset of the filling graph?
I'm no expert by any means, but I suspect you might be forgetting to use scaled units (they will never have a decimal place. Units are scaled to integer-like values. 1,000,000x larger than the "real" value.)
The distance, etc is taken from the const FillParams ¶ms,
that are sent as an argument to the _fill_surface_single().
But, the spacing is derived from the Fill -- which is what should be calling this _fill_surface_single.
So, without knowing more details about what you're doing it's difficult to help you. It all changes depending on what and where you are trying to do it.
I suggest you forget about the function we've been talking about, and look how the support material uses the fillers. It seems much easier to adapt as needed:
@n8bot Hi, I want to refer to demo, write an interface, directly pass polygons, see the filling effect. I'd like to ask some questions: Fill_params. density = float(filler->Spacing / 50.0);What does spacing mean, and what does 50.0 mean? 2, is there any parameter to set the filling line width;
The line width is really just an idea, though. The polyline coordinates are based on the centerlines of the extrusions. The height and width of the lines are basically metadata that is used in other places. Think about the gcode output that PS is doing: it defines the X, Y, and Z coordinates of the polylines explicitly. But the thickness in height and width is determined implicitly by the extrusion amounts. The width and height are essentially decoupled from the coordinates of the path.
[Edit: I forgot to mention -- the Flow
is where the line width is determined, essentially.]
@n8bot ,hi,I set spacing=5mm and density=0.5. The SVG image generated at this density, with the padding line width set to 5mm, should have 1:1 padding line width and padding line spacing, but the resulting SVG image looks like this, what am I wrong?
std::unique_ptr
Slic3r::Points ps; ps.push_back(Point(0, 0)); ps.push_back(Point(50000000, 0)); ps.push_back(Point(50000000, 50000000)); ps.push_back(Point(0, 50000000)); Slic3r::Polygon p1(ps); ttp.push_back(p1);
ClipperLib::PolyFillType fill_type = ClipperLib::pftEvenOdd; // pftNonZero;
Slic3r::ExPolygons xxp = union_ex(ttp, fill_type);
filler->angle = float(angle);
BoundingBox bbox = get_extents(xxp);
printf("xxp.size()=%d\n", xxp.size());
char buf[128];
sprintf(buf, "e:\\data\\temp\\square_with_holes_xxp_xx.svg");
SVG svg(buf, bbox);
svg.draw_outline(xxp, "black", "blue", 1*1000*1000);
for (int i = 0; i < xxp.size(); i++)
{
Slic3r::Polylines paths = test(xxp[i]);
svg.draw(paths, "red", 0.5*1000*1000);
}
svg.Close();
I'm not sure what information you need.
The spacing + density define how far apart those lines are.
The width of the lines is not set or relevant to these tests. They are testing the infill pattern, not the extrusion width. No extrusion width is used in these tests. If you want the SVG output lines to be different, you will have to edit the SVG. If the SVG is using a stroke value, this will be easy. Simply increase the stroke to your liking.
But this is getting farther from my knowledge of PrusaSlicer, and into the realm of general knowledge.
I'm not sure what information you need.
The spacing + density define how far apart those lines are.
The width of the lines is not set or relevant to these tests. They are testing the infill pattern, not the extrusion width. No extrusion width is used in these tests. If you want the SVG output lines to be different, you will have to edit the SVG. If the SVG is using a stroke value, this will be easy. Simply increase the stroke to your liking.
But this is getting farther from my knowledge of PrusaSlicer, and into the realm of general knowledge.
@n8bot ,hi,I want to express that the SVG diagram I got is not consistent with the density I set. I want to know what is wrong and I hope to get your help. The SVG diagram and code have been pasted, please help to have a look.Thank you very much!
The width of the SVG lines does not relate to anything, even if you multiply them by a million it seems.
I have sliced something in the software with 0.5 mm spacing, and 50% density, which should provide a similar result to yours. When I scale it and overlay it against your SVG, we can see what is happening and how the line thickness of the SVG is misleading.
The black rectangle is defining only the inner part, there is no line width accounted for on its edge. The yellow you see in the overlaid image is the perimeters -- as you see, the black line of the rectangle in your SVG is on the edge of the inside of the perimeter.
@n8bot ,hi,“ filler->angle = float(-(PI)/2.0); ” ,May I ask how to set the Angle so that I can set the filling Angle from 0 degrees to 360 degrees?
Yes. The angle is set in radians. So, if I remember correctly, a value of pi is 180 degrees.
@n8bot ,hi, I would like to ask you another question. Where is the parameter "fill/contour overlap" set in the fill module?
The overlap is done differently depending on the infill type. I like the way rectilinear does it, with an ExPolygonWithOffset
It is essentially just an offset of the input polygon for the fill.
Closing. Feel free to continue in the discussion, but it clutters the (already a bit long) list of open issues.
@n8bot, hi, I do not understand the use of "ExPolygonWithOffset", could you please give me a demo to use it to offset the filling line? If it is honeycomb filling, how to offset the filling line? Looking forward to your reply. thank you
For the honeycomb infill. the input ExPolygon itself is offet.
The ExPolygonWithOffset
is a special type that contains information about offset polygons, which seems made for the purpose of accounting for the overlap of infill, but is only used for rectilinear.
Hello everyone, I want to know the calculation relationship between the spacing and density of honeycomb filling, and where to set the offset distance between the filling graph and the polygon, and what is the unit of the coordinates of the filled polygon. I hope you can give me your advice, thank you very much.