intersecting faces in sketchup rupy

432 views Asked by At

When I draw simple two faces I ended up with those faces not like in sketchup e.g drawing two intersected faces...

face1 = ent.add_face([0, 0, 0], [20, 0, 0], [20, 20, 0], [0, 20, 0])
face2 = ent.add_face([5, -5, 0], [10, -5, 0], [10, 25, 0], [5, 25, 0])

I want these two faces to be intersected or all the intersected edges has to be divided and the faces will be divided too.

1

There are 1 answers

0
Jim On

One way is to add a Group, then add the faces to the Group, and then explode the Group afterwards.

model = Sketchup.active_model
ents  = model.entities

grp    = ents.add_group
g_ents = grp.entities

g_ents.add_face([0, 0, 0], [20, 0, 0], [20, 20, 0], [0, 20, 0])
g_ents.add_face([5, -5, 0], [10, -5, 0], [10, 25, 0], [5, 25, 0])

grp.explode