6Boxes.3dm (3.2 MB)
In the above, there are six boxes.
With UseExtrusions
set to Polysurfaces
:
Box1 is made with the box command
Box2 is an extruded rectangle curve (via Gumball)
Box3 is an extruded rectangular plane surface (via Gumball)
With UseExtrusions
set to Extrusions
:
Box4 is made with the box command
Box5 is an extruded rectangle curve (via Gumball)
Box6 is an extruded rectangular plane surface (via Gumball)
Now, run the following code on each of the boxes in turn:
import rhinoscriptsyntax as rs
obj_id=rs.GetObject("Select a box",16,preselect=True)
brep=rs.coercebrep(obj_id)
for i,face in enumerate(brep.Faces):
print("Face {}: {}".format(i,face.UnderlyingSurface()))
Result Box1:
Face 0: <Rhino.Geometry.NurbsSurface object at 0x000000000000003F [Rhino.Geometry.NurbsSurface]>
Face 1: <Rhino.Geometry.NurbsSurface object at 0x0000000000000040 [Rhino.Geometry.NurbsSurface]>
Face 2: <Rhino.Geometry.NurbsSurface object at 0x0000000000000041 [Rhino.Geometry.NurbsSurface]>
Face 3: <Rhino.Geometry.NurbsSurface object at 0x0000000000000042 [Rhino.Geometry.NurbsSurface]>
Face 4: <Rhino.Geometry.NurbsSurface object at 0x0000000000000043 [Rhino.Geometry.NurbsSurface]>
Face 5: <Rhino.Geometry.NurbsSurface object at 0x0000000000000044 [Rhino.Geometry.NurbsSurface]>
Result Box2 & Box3:
Face 0: <Rhino.Geometry.PlaneSurface object at 0x0000000000000045 [Rhino.Geometry.PlaneSurface]>
Face 1: <Rhino.Geometry.SumSurface object at 0x0000000000000046 [Rhino.Geometry.SumSurface]>
Face 2: <Rhino.Geometry.SumSurface object at 0x0000000000000047 [Rhino.Geometry.SumSurface]>
Face 3: <Rhino.Geometry.SumSurface object at 0x0000000000000048 [Rhino.Geometry.SumSurface]>
Face 4: <Rhino.Geometry.SumSurface object at 0x0000000000000049 [Rhino.Geometry.SumSurface]>
Face 5: <Rhino.Geometry.PlaneSurface object at 0x000000000000004A [Rhino.Geometry.PlaneSurface]>
Result Box4 & Box5:
Face 0: <Rhino.Geometry.NurbsSurface object at 0x0000000000000051 [Rhino.Geometry.NurbsSurface]>
Face 1: <Rhino.Geometry.NurbsSurface object at 0x0000000000000052 [Rhino.Geometry.NurbsSurface]>
Face 2: <Rhino.Geometry.NurbsSurface object at 0x0000000000000053 [Rhino.Geometry.NurbsSurface]>
Face 3: <Rhino.Geometry.NurbsSurface object at 0x0000000000000054 [Rhino.Geometry.NurbsSurface]>
Face 4: <Rhino.Geometry.PlaneSurface object at 0x0000000000000055 [Rhino.Geometry.PlaneSurface]>
Face 5: <Rhino.Geometry.PlaneSurface object at 0x0000000000000056 [Rhino.Geometry.PlaneSurface]>
Result Box6:
Face 0: <Rhino.Geometry.PlaneSurface object at 0x0000000000000087 [Rhino.Geometry.PlaneSurface]>
Face 1: <Rhino.Geometry.SumSurface object at 0x0000000000000088 [Rhino.Geometry.SumSurface]>
Face 2: <Rhino.Geometry.SumSurface object at 0x0000000000000089 [Rhino.Geometry.SumSurface]>
Face 3: <Rhino.Geometry.SumSurface object at 0x000000000000008A [Rhino.Geometry.SumSurface]>
Face 4: <Rhino.Geometry.SumSurface object at 0x000000000000008B [Rhino.Geometry.SumSurface]>
Face 5: <Rhino.Geometry.PlaneSurface object at 0x000000000000008C [Rhino.Geometry.PlaneSurface]>
Being that they are simple boxes, I would have thought that all the underlying surfaces would be PlaneSurface
objects. Or at least that all the results would be the same with the same UseExtrusions
setting. But nope.
I noticed this when looking at the results of my replace planar faces script, I was trying to ignore any objects that already had all simple plane surface (as defined by their underlying surfaces). I was surprised to see that simple boxes were getting their faces replaced as well because at least one of the face’s underlying surface was not a PlaneSurface
object. It’s not a big deal, but I just thought it odd.