How can I get the curve that is result from intersect solid and plane?
I am using this:
Plane plane = new Plane(XYZ.BasisZ,point); Solid cast = BooleanOperationsUtils.CutWithHalfSpace(solid, plane);
But don't know is the right way....?
thx..
from the resulting solid (cast) find the face with normal (0,0,-1). The edges are the required curve(s)
SketchPlane skPlane = SketchPlane.Create(document, plane); Solid cast = BooleanOperationsUtils.CutWithHalfSpace(solid, plane); PlanarFace CutFace = null; foreach (Face face in cast.Faces) { PlanarFace planFace = face as PlanarFace; if (planFace == null) continue; if (planFace.FaceNormal.IsAlmostEqualTo(XYZ.BasisZ.Negate()) && planFace.Origin.Z == point.Z) { CutFace = planFace; } } if (CutFace == null) return Result.Failed; CurveLoop _boundery = CutFace.GetEdgesAsCurveLoops().First(); foreach (Curve c in _boundery) { document.FamilyCreate.NewModelCurve(c, skPlane); }
Hi FAIR59,
I think that there may be more than a single Face in the result.
E.g. if cutting an "O" shaped solid into a half, making a "C", there will be two intersection faces on the "C"'s endings.
Revitalizer
Hi Revitalizer,
you're right. To find all the curves in the plane, you need to make a list of faces that pass the test, instead of the single CutFace.
And of course you'd need to process every Curveloop in the FoundFace.GetEdgesAsCurveLoops(), instead of only the first.