I am having to use Extrusions created from Box object to build a frame. I need to be able to find the neighboring objects for a given extrusion, however, all the extrusions have 6 surfaces but only 5 distinct surface normals.
Sides whose surface normals are parallel to the box’s plane’s normal turns out to be co-directional. is this correct behaviour? if this is consistent behaviour then how can I create a cuboid with 6 anti-parallel sides?
it looks like i have found a solution but not sure if it is a brute force or there are more elegant/succinct solutions.
basically i am computing a point above the surface using its normal then testing if it is inside the bounding box of the extrusion. if it is then the normal has to be taken as opposite.
var brep=extrusion.ToBrep();
if (!Intersection.BrepSurface(brep, surface, 1D, out var curves, out var pts)) continue;
if ((curves == null || curves.Length == 0) && (pts == null || pts.Length == 0)) continue;
I’m not quite sure what you doing. But if, using Rhino, you run the Box command and make a box. The select it and run the Dir command, you can see that all of the face normals point outwards.
var plane =new Plane(data.Origin, Vector3d.ZAxis);
var box =new Box(plane, new BoundingBox(Point3d.Origin, new Point3d(data.Length, data.Depth, data.Width)));
var result = Extrusion.CreateBoxExtrusion(box);
if you check the result (extrusion) then you will see what i mean