'break_edges' behavior wrong when in a group context
-
Hi,
As you know, Sketchup.break_edges is always set to true by defaut.
My script generates several lines in a group context. As you will see in the animation, 2 lines crossing the face have been drawn but they are not break when the second one is drawn.
The resulting number of faces within the group is 2 instead of 4.
The resulting number of edges within the group is 10 instead of 12.
Running the script in a component context does the same.
Why that ?
I didn't find a workaround. Any idea ?
-
Collect all of the grouped edges, the use intersect to break the edges and faces...
https://ruby.sketchup.com/Sketchup/Entities.html#intersect_with-instance_methodIf that doesn't work, then try adding a temporary short edge perpendicular to the faces' plane, at the non-splitting intersection which should break the crossing edges and separate the faces...
Delete the short edge afterwards... -
Thanks TIG.
Unfortunately intersect_with_instance doesn't work. I tried to insert short edges at intersections that are an issue, but this doesn't solve the problem either.
So next step is to compute everything 'virtually' (storing the inner edges (not as Sketchup::Edge)) in an array and drawing all edges at the end of the process.
I wonder why the API works OK at the top level of the model but doesn't do the same job in a group or component context... -
Oh and iterating through the inner edges array and use edge.find_faces doesn't help...
-
Did you try deleting all faces and then using edge.fine_faces ?
-
Yesssss ! Deleting all faces before using find_faces WORKS.
Thanks a lot TIG
Advertisement