public static List<GeometryBase> CurveWithOutControlPoint(List<GeometryBase>…
- User
public static List CurveWithOutControlPoint(List inputGeometrie) { List outputList = new(); List allCurves = new(); foreach (var geo in inputGeometrie) { if (geo is Curve crv) { allCurves.Add(crv); }
for (int i = 0; i < allCurves.Count; i++) { for (int j = 0; j < allCurves.Count; j++) { if (allCurves[i] == allCurves[j])continue; } } } return outputList;}
- Assistant
It looks like you are trying to create a method that processes a list of geometric objects (specifically curves) and aims to populate an output list of these curves, but you're currently iterating over them without adding any logic for processing or removing control points.
Here's a refined version of your code that might align with what you're looking to achieve—removing curves that are duplicates (if that's part of your intention):
public static List<GeometryBase> CurveWithoutControlPoints(List<GeometryBase> inputGeometries) { List<GeometryBase> outputList = new(); HashSet<Curve> uniqueCurves = new(); foreach (var geo in inputGeometries) { if (geo is Curve crv) { // Add to a HashSet to filter out duplicates uniqueCurves.Add(crv); } } // Optionally, convert unique curves back to a list of GeometryBase if needed outputList.AddRange(uniqueCurves); return outputList; } - User
I have a list of Curves in Rhino3d. in this list of Curves there are some Curve that are in continues of each other and I want to if there is such curves create a new line from the start of first one to the end of second line . and check that the new line is in continues of other curves or not. at the end I want to don't have any segmented curve if its possible to have one instead of all of them.
- Assistant
- User
you should check the cross product of 2 curves too, to check if they are really in continues of each other in one direction and if so do the merging operation.(if the cross product is equal to 0 its true)
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.