How to create a face with a hole touching its edge?
-
Always add the inner face, and then add the outer face.
Then the inner face should erase as you hope. -
@tig said:
Always add the inner face, and then add the outer face.
Then the inner face should erase as you hope.Tried that, didn't work for me.
I also tried to intersect; group & explode; nuffin' worked. The dark force is string with this geometry.
-
strong dark force !!!
Another case does not work!
I can not get the correct offset of the left polygon. The hole is not empty in Sketchup.
-
@tt_su said:
@tig said:
Always add the inner face, and then add the outer face.
Then the inner face should erase as you hope.Tried that, didn't work for me.
I also tried to intersect; group & explode; nuffin' worked. The dark force is string with this geometry.
Works when you draw on the GUI in the order TIG suggests, but I also can't get it to work via Ruby. Where are the Jedi when we need them?
-
Try making the inner face then using find_faces on the added outer edges, rather than making that face directly.
Then the inner face should then be retained for erase!, and the outer one remains as a loop.The reason your API 'offset' leaves a hole and SketchUp doesn't is [I suspect] along these lines too...
-
@tig said:
Try making the inner face then using find_faces on the added outer edges, rather than making that face directly.
Then the inner face should then be retained for erase!, and the outer one remains as a loop.The reason your API 'offset' leaves a hole and SketchUp doesn't is [I suspect] along these lines too...
Hi TIG,
I am not sure I understand you well. Could you post the code, that how exactly should I do it? Thanks in advance!
-
That's a bug. Won't intersect either.
I wonder if it's related to this problem.. Some funny thing going on here,
although this is done by hand.Face is recognized somehow although deleted..
-
Not too much code either.
-
@tig said:
Try making the inner face then using find_faces on the added outer edges, rather than making that face directly.
Then the inner face should then be retained for erase!, and the outer one remains as a loop.The reason your API 'offset' leaves a hole and SketchUp doesn't is [I suspect] along these lines too...
GREAT!!!! You are the Jedi!!!
so the code is:
e = Sketchup.active_model.entities f1 = e.add_face [1,1,0],[8,1,0],[4,5,0] f2 = e.add_face [2,2,0],[7,2,0],[4,4,0] ed = f1.edges[0] f1.erase! ed.find_faces; f2.erase!
-
Some observations.....
The sketchup offset tool is not consistent. It does not always provide the same result....sometime gives the left, sometime gives the right.
They are slightly different.
Both results have two faces, a bigger face and a small one(the hole).
The bigger face is selected in both results, while the small one is not selected.
On the left, the small one is separated from the bigger face, i.e. the bigger face contains a hole.
On the right, the small one is overlapped with the bigger face, i.e. the bigger face does not contain a hole.
.......
Advertisement