For some reason when i’m trying to display a shaded brep with display conduit it does not display the whole brep. You can see what i mean by that in the figure below. Any ideas what could be wrong? I did draw the geometry in the postdraw method of the display conduit wit the following code:
e.Display.DrawBrepShaded(corbel, new DisplayMaterial(Color.Black, 0.5));
Thank you @dale! It worked perfectly. It was the kinky face problem. Just for the record here is dales fix to my problem if some people ran into this problem in future:
// Extrude the planar curve
var dir = new Vector3d(0, convertToDouble(textBox_b.Text), 0);
var srf = Surface.CreateExtrusion(curve, dir);
// Create a Brep from the surface
var brep = srf.ToBrep();
// The profile curve is a degree=1 curve. Thus, the extruded surface will
// have kinks. Because kinked surface can cause problems down stream, Rhino
// always splits kinked surfaces when adding Breps to the document. Since
// we are not adding this Brep to the document, lets split the kinked
// surfaces ourself.
brep.Faces.SplitKinkyFaces(RhinoMath.DefaultAngleTolerance, true);
// Cap any planar holes
var capped_brep = brep.CapPlanarHoles(RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);
// The profile curve, created by the input points, is oriented clockwise.
// Thus when the profile is extruded, the resulting surface will have its
// normals pointed inwards. So lets check the orientation and, if inwards,
// flip the face normals.
if (BrepSolidOrientation.Inward == capped_brep.SolidOrientation)
capped_brep.Flip();
Now that I think I think I had a similar problem one year ago. Human mind is forgetful.