Hi Everyone,
I’m working on a 3D print pricing tool where I’m having to sort interior from exterior contour curves. This is needed so I can then minus the area of the interior curves from the area of the external curves to work out part pricing.
Here’s a snippet of my C# script:
for (int i = 0; i < crvTree.BranchCount; i++){
List<Point3d> measurePoint = new List<Point3d>();
List<Curve> measureCurve = new List<Curve>();
int elementCount = crvTree.Branch(i).Count;
for( int j = 0; j < elementCount; j++){
measurePoint.Add(crvTree.Branch(i)[j].PointAt(0.0));
measureCurve.Add(crvTree.Branch(i)[j]);
}
int mPointCount = measurePoint.Count;
for( int k = 0; k < mPointCount; k++){
if (measurePoint.Count > 1){
Curve conTest = measureCurve[k]; // Comparison Curve Creation
measurePoint.Remove(measurePoint[k]); // Comparison Point List Creation
measureCurve.Remove(measureCurve[k]);
for( int m = 0; m < measurePoint.Count; m++){
if( conTest.Contains(measurePoint[m], new Plane(conTest.PointAt(0.0), new Vector3d(0, 0, 1)), 0.1).ToString() == "Inside"){
Print("Hello");
} else
Print("not today");
}
}}}
For a reason unknown to me, I’m not triggering any positive result for my Contains operation.
Any help would be much appreciated.
Best,
Darcy
Contour+Sort.gh (62.6 KB)