Class Curve
- Namespace
- OpenMEPSandbox.Geometry
- Assembly
- OpenMEPSandbox.dll
public class Curve
- Inheritance
-
Curve
- Inherited Members
Methods
AsLine(Curve)
Convert a curve simple to line
public static Line AsLine(Curve curve)
Parameters
curve
Curvecurve need to convert
Returns
- Line
Line
Examples
BezierSegment(Point, Point, Point, Point, int)
Generates a Bézier curve segment based on four control points.
public static List<Point> BezierSegment(Point start, Point startHandler, Point endHandler, Point end, int numPoints = 20)
Parameters
start
PointThe starting point of the segment.
startHandler
PointThe control point that determines the tangent of the curve at the starting point.
endHandler
PointThe control point that determines the tangent of the curve at the ending point.
end
PointThe ending point of the segment.
numPoints
intThe number of points to generate on the curve.
Returns
- List<Point>
A list of Point3D objects representing the points on the Bézier curve segment.
Examples
DeconstructPolyCurve(PolyCurve)
Get segment and vertices of a polycurve Use Open Source From lunchbox package : https://bitbucket.org/provingground-io/lunchbox-for-dynamo/src/master/
[MultiReturn(new string[] { "Segments", "Points" })]
public static Dictionary<string, object> DeconstructPolyCurve(PolyCurve polycurve)
Parameters
polycurve
PolyCurvePolyCurve
Returns
- Dictionary<string, object>
PolyCurve segments.
DivideCurve(Curve, double)
Divides a curve evenly along the parameter space Use Open Source From lunchbox package : https://bitbucket.org/provingground-io/lunchbox-for-dynamo/src/master/
[MultiReturn(new string[] { "Points", "Planes", "Tangents", "Parameters" })]
public static Dictionary<string, object> DivideCurve(Curve curve, double Number)
Parameters
curve
CurveCurve to divide
Number
doubleNumber of divisions
Returns
- Dictionary<string, object>
A list of points
DivideCurveByDistance(Curve, double)
Divides a curve using a distance between segments Use Open Source From lunchbox package : https://bitbucket.org/provingground-io/lunchbox-for-dynamo/src/master/
[MultiReturn(new string[] { "Points", "Planes", "Tangents", "Distances", "Parameters" })]
public static Dictionary<string, object> DivideCurveByDistance(Curve curve, double Distance)
Parameters
curve
CurveCurve to divide
Distance
doubleDistance between curve segments
Returns
- Dictionary<string, object>
A list of points
EndPoints(Curve)
Gets start and end points and parameter values Use Open Source From lunchbox package : https://bitbucket.org/provingground-io/lunchbox-for-dynamo/src/master/
[MultiReturn(new string[] { "StartPoint", "EndPoint", "StartParameter", "EndParameter" })]
public static Dictionary<string, object> EndPoints(Curve curve)
Parameters
curve
CurveCurve
Returns
- Dictionary<string, object>
Start point.
SplitByPoints(Curve, List<Point>)
splits the curve at each point in the input list, creating a new curve between each adjacent pair of points
public static List<Curve> SplitByPoints(Curve curve, List<Point> points)
Parameters
curve
CurveThe input curve to be split.
points
List<Point>A list of points that represent the locations at which to split the curve.
Returns
- List<Curve>
A list of curves that result from splitting the input curve at the specified points
Examples
SplitBySegmentsLength(Curve, double)
splits a curve into segments of a specified length
public static List<Curve> SplitBySegmentsLength(Curve curve, double segmentLength)
Parameters
curve
CurveThe input curve to be split.
segmentLength
doubleA number that represents the length of each segment to split the curve into, or a list of numbers that represent the lengths of the segments to split the curve into.
Returns
- List<Curve>
A list of curves that result from splitting the input curve at the specified segment lengths.
Examples
Curve.SplitBySegmentsLength.dyn
SplitBySegmentsLengths(Curve, List<double>)
splits a curve into segments of varying lengths specified by a list of segment lengths
public static List<Curve> SplitBySegmentsLengths(Curve curve, List<double> segmentLengths)
Parameters
curve
CurveThe input curve to be split.
segmentLengths
List<double>A list of numbers that represent the lengths of the segments to split the curve into.
Returns
- List<Curve>
A list of curves that result from splitting the input curve at the specified segment lengths.
Examples
Curve.SplitBySegmentsLengths.dyn
ToPoints(Curve, int)
Converts a curve to a list of points based on the specified number of points.
public static List<Point> ToPoints(Curve curve, int numPoints)
Parameters
curve
CurveThe curve to convert to a list of points.
numPoints
intThe number of points to generate on the curve.
Returns
- List<Point>
A list of Point3D objects representing the points on the curve.