```
///
``````
///
``````
///
```

```
public static Brep CreateEdgeSurface(IEnumerable
``` curves)
{
return ComputeServer.Post(ApiAddress(), curves);
}
///
/// Constructs a set of planar Breps as outlines by the loops.
///
/// Curve loops that delineate the planar boundaries.
/// An array of Planar Breps or null on error.
public static Brep[] CreatePlanarBreps(Rhino.Collections.CurveList inputLoops)
{
return ComputeServer.Post(ApiAddress(), inputLoops);
}
///
/// Constructs a set of planar Breps as outlines by the loops.
///
/// Curve loops that delineate the planar boundaries.
///
/// An array of Planar Breps.
public static Brep[] CreatePlanarBreps(Rhino.Collections.CurveList inputLoops, double tolerance)
{
return ComputeServer.Post(ApiAddress(), inputLoops, tolerance);
}
///
/// Offsets a face including trim information to create a new brep.
///
/// the face to offset.
/// An offset distance.
///
/// Use 0.0 to make a loose offset. Otherwise, the document's absolute tolerance is usually sufficient.
///
/// When true, offset to both sides of the input face.
/// When true, make a solid object.
///
/// A new brep if successful. The brep can be disjoint if bothSides is true and createSolid is false,
/// or if createSolid is true and connecting the offsets with side surfaces fails.
/// null if unsuccessful.
///
public static Brep CreateFromOffsetFace(BrepFace face, double offsetDistance, double offsetTolerance, bool bothSides, bool createSolid)
{
return ComputeServer.Post(ApiAddress(), face, offsetDistance, offsetTolerance, bothSides, createSolid);
}
///
/// Constructs closed polysurfaces from surfaces and polysurfaces that bound a region in space.
///
///
/// The intersecting surfaces and polysurfaces to automatically trim and join into closed polysurfaces.
///
///
/// The trim and join tolerance. If set to RhinoMath.UnsetValue, Rhino's global absolute tolerance is used.
///
/// The resulting polysurfaces on success or null on failure.
public static Brep[] CreateSolid(IEnumerable breps, double tolerance)
{
return ComputeServer.Post(ApiAddress(), breps, tolerance);
}
///
/// Merges two surfaces into one surface at untrimmed edges.
///
/// The first surface to merge.
/// The second surface to merge.
/// Surface edges must be within this tolerance for the two surfaces to merge.
/// Edge must be within this angle tolerance in order for contiguous edges to be combined into a single edge.
/// The merged surfaces as a Brep if successful, null if not successful.
public static Brep MergeSurfaces(Surface surface0, Surface surface1, double tolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), surface0, surface1, tolerance, angleToleranceRadians);
}
///
/// Merges two surfaces into one surface at untrimmed edges. Both surfaces must be untrimmed and share an edge.
///
/// The first single-face Brep to merge.
/// The second single-face Brep to merge.
/// Surface edges must be within this tolerance for the two surfaces to merge.
/// Edge must be within this angle tolerance in order for contiguous edges to be combined into a single edge.
/// The merged Brep if successful, null if not successful.
public static Brep MergeSurfaces(Brep brep0, Brep brep1, double tolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), brep0, brep1, tolerance, angleToleranceRadians);
}
///
/// Merges two surfaces into one surface at untrimmed edges. Both surfaces must be untrimmed and share an edge.
///
/// The first single-face Brep to merge.
/// The second single-face Brep to merge.
/// Surface edges must be within this tolerance for the two surfaces to merge.
/// Edge must be within this angle tolerance in order for contiguous edges to be combined into a single edge.
/// 2D pick point on the first single-face Brep. The value can be unset.
/// 2D pick point on the second single-face Brep. The value can be unset.
/// Defines the roundness of the merge. Acceptable values are between 0.0 (sharp) and 1.0 (smooth).
/// The surface will be smooth. This makes the surface behave better for control point editing, but may alter the shape of both surfaces.
/// The merged Brep if successful, null if not successful.
public static Brep MergeSurfaces(Brep brep0, Brep brep1, double tolerance, double angleToleranceRadians, Point2d point0, Point2d point1, double roundness, bool smooth)
{
return ComputeServer.Post(ApiAddress(), brep0, brep1, tolerance, angleToleranceRadians, point0, point1, roundness, smooth);
}
///
/// Constructs a brep patch.
/// This is the simple version of fit that uses a specified starting surface.
///
///
/// Combination of Curves, BrepTrims, Points, PointClouds or Meshes.
/// Curves and trims are sampled to get points. Trims are sampled for
/// points and normals.
///
/// A starting surface (can be null).
///
/// Tolerance used by input analysis functions for loop finding, trimming, etc.
///
///
/// Brep fit through input on success, or null on error.
///
public static Brep CreatePatch(IEnumerable geometry, Surface startingSurface, double tolerance)
{
return ComputeServer.Post(ApiAddress(), geometry, startingSurface, tolerance);
}
///
/// Constructs a brep patch.
/// This is the simple version of fit that uses a plane with u x v spans.
/// It makes a plane by fitting to the points from the input geometry to use as the starting surface.
/// The surface has the specified u and v span count.
///
///
/// A combination of curves , brep trims,
/// points , point clouds or meshes .
/// Curves and trims are sampled to get points. Trims are sampled for
/// points and normals.
///
/// The number of spans in the U direction.
/// The number of spans in the V direction.
///
/// Tolerance used by input analysis functions for loop finding, trimming, etc.
///
///
/// A brep fit through input on success, or null on error.
///
public static Brep CreatePatch(IEnumerable geometry, int uSpans, int vSpans, double tolerance)
{
return ComputeServer.Post(ApiAddress(), geometry, uSpans, vSpans, tolerance);
}
///
/// Constructs a brep patch using all controls
///
///
/// A combination of curves , brep trims,
/// points , point clouds or meshes .
/// Curves and trims are sampled to get points. Trims are sampled for
/// points and normals.
///
/// A starting surface (can be null).
///
/// Number of surface spans used when a plane is fit through points to start in the U direction.
///
///
/// Number of surface spans used when a plane is fit through points to start in the U direction.
///
///
/// If true, try to find an outer loop from among the input curves and trim the result to that loop
///
///
/// If true, try to find brep trims in the outer loop of curves and try to
/// fit to the normal direction of the trim's surface at those locations.
///
///
/// Basic distance between points sampled from input curves.
///
///
/// Determines the behavior of the surface in areas where its not otherwise
/// controlled by the input. Lower numbers make the surface behave more
/// like a stiff material; higher, less like a stiff material. That is,
/// each span is made to more closely match the spans adjacent to it if there
/// is no input geometry mapping to that area of the surface when the
/// flexibility value is low. The scale is logrithmic. Numbers around 0.001
/// or 0.1 make the patch pretty stiff and numbers around 10 or 100 make the
/// surface flexible.
///
///
/// Tends to keep the result surface where it was before the fit in areas where
/// there is on influence from the input geometry
///
///
/// Array of four elements. Flags to keep the edges of a starting (untrimmed)
/// surface in place while fitting the interior of the surface. Order of
/// flags is left, bottom, right, top
///
///
/// Tolerance used by input analysis functions for loop finding, trimming, etc.
///
///
/// A brep fit through input on success, or null on error.
///
public static Brep CreatePatch(IEnumerable geometry, Surface startingSurface, int uSpans, int vSpans, bool trim, bool tangency, double pointSpacing, double flexibility, double surfacePull, bool[] fixEdges, double tolerance)
{
return ComputeServer.Post(ApiAddress(), geometry, startingSurface, uSpans, vSpans, trim, tangency, pointSpacing, flexibility, surfacePull, fixEdges, tolerance);
}
///
/// Creates a single walled pipe
///
/// the path curve for the pipe
/// radius of the pipe
///
/// If True, Local (pipe radius stays constant at the ends and changes more rapidly in the middle) is applied.
/// If False, Global (radius is linearly blended from one end to the other, creating pipes that taper from one radius to the other) is applied
///
/// end cap mode
///
/// If the curve is a polycurve of lines and arcs, the curve is fit and a single surface is created;
/// otherwise the result is a polysurface with joined surfaces created from the polycurve segments.
///
///
/// The sweeping and fitting tolerance. If you are unsure what to use, then use the document's absolute tolerance
///
///
/// The angle tolerance. If you are unsure what to use, then either use the document's angle tolerance in radians
///
/// Array of created pipes on success
public static Brep[] CreatePipe(Curve rail, double radius, bool localBlending, PipeCapMode cap, bool fitRail, double absoluteTolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), rail, radius, localBlending, cap, fitRail, absoluteTolerance, angleToleranceRadians);
}
///
/// Creates a single walled pipe
///
/// the path curve for the pipe
///
/// one or more normalized curve parameters where changes in radius occur.
/// Important: curve parameters must be normalized - ranging between 0.0 and 1.0.
///
/// An array of radii - one at each normalized curve parameter in railRadiiParameters.
///
/// If True, Local (pipe radius stays constant at the ends and changes more rapidly in the middle) is applied.
/// If False, Global (radius is linearly blended from one end to the other, creating pipes that taper from one radius to the other) is applied
///
/// end cap mode
///
/// If the curve is a polycurve of lines and arcs, the curve is fit and a single surface is created;
/// otherwise the result is a polysurface with joined surfaces created from the polycurve segments.
///
///
/// The sweeping and fitting tolerance. If you are unsure what to use, then use the document's absolute tolerance
///
///
/// The angle tolerance. If you are unsure what to use, then either use the document's angle tolerance in radians
///
/// Array of created pipes on success
public static Brep[] CreatePipe(Curve rail, IEnumerable railRadiiParameters, IEnumerable radii, bool localBlending, PipeCapMode cap, bool fitRail, double absoluteTolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), rail, railRadiiParameters, radii, localBlending, cap, fitRail, absoluteTolerance, angleToleranceRadians);
}
///
/// General 1 rail sweep. If you are not producing the sweep results that you are after, then
/// use the SweepOneRail class with options to generate the swept geometry
///
/// Rail to sweep shapes along
/// Shape curve
/// Only matters if shape is closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
public static Brep[] CreateFromSweep(Curve rail, Curve shape, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail, shape, closed, tolerance);
}
///
/// General 1 rail sweep. If you are not producing the sweep results that you are after, then
/// use the SweepOneRail class with options to generate the swept geometry
///
/// Rail to sweep shapes along
/// Shape curves
/// Only matters if shapes are closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
public static Brep[] CreateFromSweep(Curve rail, IEnumerable shapes, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail, shapes, closed, tolerance);
}
///
/// General 2 rail sweep. If you are not producing the sweep results that you are after, then
/// use the SweepTwoRail class with options to generate the swept geometry
///
/// Rail to sweep shapes along
/// Rail to sweep shapes along
/// Shape curve
/// Only matters if shape is closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
public static Brep[] CreateFromSweep(Curve rail1, Curve rail2, Curve shape, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail1, rail2, shape, closed, tolerance);
}
///
/// General 2 rail sweep. If you are not producing the sweep results that you are after, then
/// use the SweepTwoRail class with options to generate the swept geometry
///
/// Rail to sweep shapes along
/// Rail to sweep shapes along
/// Shape curves
/// Only matters if shapes are closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
public static Brep[] CreateFromSweep(Curve rail1, Curve rail2, IEnumerable shapes, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail1, rail2, shapes, closed, tolerance);
}
///
/// Makes a 2 rail sweep. Like CreateFromSweep but the result is split where parameterization along a rail changes abruptly
///
/// Rail to sweep shapes along
/// Rail to sweep shapes along
/// Shape curves
/// Shape parameters
/// Only matters if shapes are closed
/// Tolerance for fitting surface and rails
/// Array of Brep sweep results
public static Brep[] CreateFromSweepInParts(Curve rail1, Curve rail2, IEnumerable shapes, IEnumerable rail_params, bool closed, double tolerance)
{
return ComputeServer.Post(ApiAddress(), rail1, rail2, shapes, rail_params, closed, tolerance);
}
///
/// Extrude a curve to a taper making a brep (potentially more than 1)
///
/// the curve to extrude
/// the distance to extrude
/// the direction of the extrusion
/// the basepoint of the extrusion
/// angle of the extrusion
///
/// tolerance to use for the extrusion
/// angle tolerance to use for the extrusion
/// array of breps on success
public static Brep[] CreateFromTaperedExtrude(Curve curveToExtrude, double distance, Vector3d direction, Point3d basePoint, double draftAngleRadians, ExtrudeCornerType cornerType, double tolerance, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), curveToExtrude, distance, direction, basePoint, draftAngleRadians, cornerType, tolerance, angleToleranceRadians);
}
///
/// Extrude a curve to a taper making a brep (potentially more than 1)
///
/// the curve to extrude
/// the distance to extrude
/// the direction of the extrusion
/// the basepoint of the extrusion
/// angle of the extrusion
///
/// array of breps on success
/// tolerances used are based on the active doc tolerance
public static Brep[] CreateFromTaperedExtrude(Curve curveToExtrude, double distance, Vector3d direction, Point3d basePoint, double draftAngleRadians, ExtrudeCornerType cornerType)
{
return ComputeServer.Post(ApiAddress(), curveToExtrude, distance, direction, basePoint, draftAngleRadians, cornerType);
}
///
/// Makes a surface blend between two surface edges.
///
/// First face to blend from.
/// First edge to blend from.
/// The domain of edge0 to use.
/// If false, edge0 will be used in its natural direction. If true, edge0 will be used in the reversed direction.
/// Continuity for the blend at the start.
/// Second face to blend from.
/// Second edge to blend from.
/// The domain of edge1 to use.
/// If false, edge1 will be used in its natural direction. If true, edge1 will be used in the reversed direction.
/// Continuity for the blend at the end.
/// Array of Breps if successful.
public static Brep[] CreateBlendSurface(BrepFace face0, BrepEdge edge0, Interval domain0, bool rev0, BlendContinuity continuity0, BrepFace face1, BrepEdge edge1, Interval domain1, bool rev1, BlendContinuity continuity1)
{
return ComputeServer.Post(ApiAddress(), face0, edge0, domain0, rev0, continuity0, face1, edge1, domain1, rev1, continuity1);
}
///
/// Makes a curve blend between points on two surface edges. The blend will be tangent to the surfaces and perpendicular to the edges.
///
/// First face to blend from.
/// First edge to blend from.
/// Location on first edge for first end of blend curve.
/// If false, edge0 will be used in its natural direction. If true, edge0 will be used in the reversed direction.
/// Continuity for the blend at the start.
/// Second face to blend from.
/// Second edge to blend from.
/// Location on second edge for second end of blend curve.
/// If false, edge1 will be used in its natural direction. If true, edge1 will be used in the reversed direction.
/// >Continuity for the blend at the end.
/// The blend curve on success. null on failure
public static Curve CreateBlendShape(BrepFace face0, BrepEdge edge0, double t0, bool rev0, BlendContinuity continuity0, BrepFace face1, BrepEdge edge1, double t1, bool rev1, BlendContinuity continuity1)
{
return ComputeServer.Post(ApiAddress(), face0, edge0, t0, rev0, continuity0, face1, edge1, t1, rev1, continuity1);
}
///
/// Creates a constant-radius round surface between two surfaces.
///
/// First face to fillet from.
/// A parameter face0 at the side you want to keep after filleting.
/// Second face to fillet from.
/// A parameter face1 at the side you want to keep after filleting.
/// The fillet radius.
/// If true, then when one input surface is longer than the other, the fillet surface is extended to the input surface edges.
/// The tolerance. In in doubt, the the document's model absolute tolerance.
/// Array of Breps if successful.
public static Brep[] CreateFilletSurface(BrepFace face0, Point2d uv0, BrepFace face1, Point2d uv1, double radius, bool extend, double tolerance)
{
return ComputeServer.Post(ApiAddress(), face0, uv0, face1, uv1, radius, extend, tolerance);
}
///
/// Creates a ruled surface as a bevel between two input surface edges.
///
/// First face to chamfer from.
/// A parameter face0 at the side you want to keep after chamfering.
/// The distance from the intersection of face0 to the edge of the chamfer.
/// Second face to chamfer from.
/// A parameter face1 at the side you want to keep after chamfering.
/// The distance from the intersection of face1 to the edge of the chamfer.
/// If true, then when one input surface is longer than the other, the chamfer surface is extended to the input surface edges.
/// The tolerance. In in doubt, the the document's model absolute tolerance.
/// Array of Breps if successful.
public static Brep[] CreateChamferSurface(BrepFace face0, Point2d uv0, double radius0, BrepFace face1, Point2d uv1, double radius1, bool extend, double tolerance)
{
return ComputeServer.Post(ApiAddress(), face0, uv0, radius0, face1, uv1, radius1, extend, tolerance);
}
///
/// Fillets, chamfers, or blends the edges of a brep.
///
/// The brep to fillet, chamfer, or blend edges.
/// An array of one or more edge indices where the fillet, chamfer, or blend will occur.
/// An array of starting fillet, chamfer, or blend radaii, one for each edge index.
/// An array of ending fillet, chamfer, or blend radaii, one for each edge index.
/// The blend type.
/// The rail type.
/// The tolerance to be used to perform calculations.
/// Array of Breps if successful.
public static Brep[] CreateFilletEdges(Brep brep, IEnumerable edgeIndices, IEnumerable startRadii, IEnumerable endRadii, BlendType blendType, RailType railType, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, edgeIndices, startRadii, endRadii, blendType, railType, tolerance);
}
///
/// Joins two naked edges, or edges that are coincident or close together, from two Breps.
///
/// The first Brep.
/// The edge index on the first Brep.
/// The second Brep.
/// The edge index on the second Brep.
/// The join tolerance.
/// The resulting Brep if successful, null on failure.
public static Brep CreateFromJoinedEdges(Brep brep0, int edgeIndex0, Brep brep1, int edgeIndex1, double joinTolerance)
{
return ComputeServer.Post(ApiAddress(), brep0, edgeIndex0, brep1, edgeIndex1, joinTolerance);
}
///
/// Constructs one or more Breps by lofting through a set of curves.
///
///
/// The curves to loft through. This function will not perform any curve sorting. You must pass in
/// curves in the order you want them lofted. This function will not adjust the directions of open
/// curves. Use Curve.DoDirectionsMatch and Curve.Reverse to adjust the directions of open curves.
/// This function will not adjust the seams of closed curves. Use Curve.ChangeClosedCurveSeam to
/// adjust the seam of closed curves.
///
///
/// Optional starting point of loft. Use Point3d.Unset if you do not want to include a start point.
///
///
/// Optional ending point of loft. Use Point3d.Unset if you do not want to include an end point.
///
/// type of loft to perform.
/// true if the last curve in this loft should be connected back to the first one.
///
/// Constructs a closed surface, continuing the surface past the last curve around to the
/// first curve. Available when you have selected three shape curves.
///
///
/// ```
///
``````
///
``````
///
```

```
public static Brep[] CreateFromLoft(IEnumerable
``` curves, Point3d start, Point3d end, LoftType loftType, bool closed)
{
return ComputeServer.Post(ApiAddress(), curves, start, end, loftType, closed);
}
///
/// Constructs one or more Breps by lofting through a set of curves. Input for the loft is simplified by
/// rebuilding to a specified number of control points.
///
///
/// The curves to loft through. This function will not perform any curve sorting. You must pass in
/// curves in the order you want them lofted. This function will not adjust the directions of open
/// curves. Use Curve.DoDirectionsMatch and Curve.Reverse to adjust the directions of open curves.
/// This function will not adjust the seams of closed curves. Use Curve.ChangeClosedCurveSeam to
/// adjust the seam of closed curves.
///
///
/// Optional starting point of loft. Use Point3d.Unset if you do not want to include a start point.
///
///
/// Optional ending point of lost. Use Point3d.Unset if you do not want to include an end point.
///
/// type of loft to perform.
/// true if the last curve in this loft should be connected back to the first one.
/// A number of points to use while rebuilding the curves. 0 leaves turns this parameter off.
///
/// Constructs a closed surface, continuing the surface past the last curve around to the
/// first curve. Available when you have selected three shape curves.
///
public static Brep[] CreateFromLoftRebuild(IEnumerable curves, Point3d start, Point3d end, LoftType loftType, bool closed, int rebuildPointCount)
{
return ComputeServer.Post(ApiAddress(), curves, start, end, loftType, closed, rebuildPointCount);
}
///
/// Constructs one or more Breps by lofting through a set of curves. Input for the loft is simplified by
/// refitting to a specified tolerance.
///
///
/// The curves to loft through. This function will not perform any curve sorting. You must pass in
/// curves in the order you want them lofted. This function will not adjust the directions of open
/// curves. Use Curve.DoDirectionsMatch and Curve.Reverse to adjust the directions of open curves.
/// This function will not adjust the seams of closed curves. Use Curve.ChangeClosedCurveSeam to
/// adjust the seam of closed curves.
///
///
/// Optional starting point of loft. Use Point3d.Unset if you do not want to include a start point.
///
///
/// Optional ending point of lost. Use Point3d.Unset if you do not want to include an end point.
///
/// type of loft to perform.
/// true if the last curve in this loft should be connected back to the first one.
/// A distance to use in refitting, or 0 if you want to turn this parameter off.
///
/// Constructs a closed surface, continuing the surface past the last curve around to the
/// first curve. Available when you have selected three shape curves.
///
public static Brep[] CreateFromLoftRefit(IEnumerable curves, Point3d start, Point3d end, LoftType loftType, bool closed, double refitTolerance)
{
return ComputeServer.Post(ApiAddress(), curves, start, end, loftType, closed, refitTolerance);
}
///
/// Compute the Boolean Union of a set of Breps.
///
/// Breps to union.
/// Tolerance to use for union operation.
/// An array of Brep results or null on failure.
public static Brep[] CreateBooleanUnion(IEnumerable breps, double tolerance)
{
return ComputeServer.Post(ApiAddress(), breps, tolerance);
}
///
/// Compute the Boolean Union of a set of Breps.
///
/// Breps to union.
/// Tolerance to use for union operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
public static Brep[] CreateBooleanUnion(IEnumerable breps, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), breps, tolerance, manifoldOnly);
}
///
/// Compute the Solid Intersection of two sets of Breps.
///
/// First set of Breps.
/// Second set of Breps.
/// Tolerance to use for intersection operation.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanIntersection(IEnumerable firstSet, IEnumerable secondSet, double tolerance)
{
return ComputeServer.Post(ApiAddress(), firstSet, secondSet, tolerance);
}
///
/// Compute the Solid Intersection of two sets of Breps.
///
/// First set of Breps.
/// Second set of Breps.
/// Tolerance to use for intersection operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanIntersection(IEnumerable firstSet, IEnumerable secondSet, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), firstSet, secondSet, tolerance, manifoldOnly);
}
///
/// Compute the Solid Intersection of two Breps.
///
/// First Brep for boolean intersection.
/// Second Brep for boolean intersection.
/// Tolerance to use for intersection operation.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanIntersection(Brep firstBrep, Brep secondBrep, double tolerance)
{
return ComputeServer.Post(ApiAddress(), firstBrep, secondBrep, tolerance);
}
///
/// Compute the Solid Intersection of two Breps.
///
/// First Brep for boolean intersection.
/// Second Brep for boolean intersection.
/// Tolerance to use for intersection operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanIntersection(Brep firstBrep, Brep secondBrep, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), firstBrep, secondBrep, tolerance, manifoldOnly);
}
///
/// Compute the Solid Difference of two sets of Breps.
///
/// First set of Breps (the set to subtract from).
/// Second set of Breps (the set to subtract).
/// Tolerance to use for difference operation.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
///
/// ```
///
``````
///
``````
///
```

```
public static Brep[] CreateBooleanDifference(IEnumerable
``` firstSet, IEnumerable secondSet, double tolerance)
{
return ComputeServer.Post(ApiAddress(), firstSet, secondSet, tolerance);
}
///
/// Compute the Solid Difference of two sets of Breps.
///
/// First set of Breps (the set to subtract from).
/// Second set of Breps (the set to subtract).
/// Tolerance to use for difference operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
///
/// ```
///
``````
///
``````
///
```

```
public static Brep[] CreateBooleanDifference(IEnumerable
``` firstSet, IEnumerable secondSet, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), firstSet, secondSet, tolerance, manifoldOnly);
}
///
/// Compute the Solid Difference of two Breps.
///
/// First Brep for boolean difference.
/// Second Brep for boolean difference.
/// Tolerance to use for difference operation.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanDifference(Brep firstBrep, Brep secondBrep, double tolerance)
{
return ComputeServer.Post(ApiAddress(), firstBrep, secondBrep, tolerance);
}
///
/// Compute the Solid Difference of two Breps.
///
/// First Brep for boolean difference.
/// Second Brep for boolean difference.
/// Tolerance to use for difference operation.
/// If true, non-manifold input breps are ignored.
/// An array of Brep results or null on failure.
/// The solid orientation of the breps make a difference when calling this function
public static Brep[] CreateBooleanDifference(Brep firstBrep, Brep secondBrep, double tolerance, bool manifoldOnly)
{
return ComputeServer.Post(ApiAddress(), firstBrep, secondBrep, tolerance, manifoldOnly);
}
///
/// Creates a hollowed out shell from a solid Brep. Function only operates on simple, solid, manifold Breps.
///
/// The solid Brep to shell.
/// The indices of the Brep faces to remove. These surfaces are removed and the remainder is offset inward, using the outer parts of the removed surfaces to join the inner and outer parts.
/// The distance, or thickness, for the shell. This is a signed distance value with respect to face normals and flipped faces.
/// The offset tolerane. When in doubt, use the document's absolute tolerance.
/// An array of Brep results or null on failure.
public static Brep[] CreateShell(Brep brep, IEnumerable facesToRemove, double distance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, facesToRemove, distance, tolerance);
}
///
/// Joins the breps in the input array at any overlapping edges to form
/// as few as possible resulting breps. There may be more than one brep in the result array.
///
/// A list, an array or any enumerable set of breps to join.
/// 3d distance tolerance for detecting overlapping edges.
/// new joined breps on success, null on failure.
public static Brep[] JoinBreps(IEnumerable brepsToJoin, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brepsToJoin, tolerance);
}
///
/// Combines two or more breps into one. A merge is like a boolean union that keeps the inside pieces. This
/// function creates non-manifold Breps which in general are unusual in Rhino. You may want to consider using
/// JoinBreps or CreateBooleanUnion functions instead.
///
/// must contain more than one Brep.
/// the tolerance to use when merging.
/// Single merged Brep on success. Null on error.
///
public static Brep MergeBreps(IEnumerable brepsToMerge, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brepsToMerge, tolerance);
}
///
/// Constructs the contour curves for a brep at a specified interval.
///
/// A brep or polysurface.
/// A point to start.
/// A point to use as the end.
/// The interaxial offset in world units.
/// An array with intersected curves. This array can be empty.
///
/// ```
///
``````
///
``````
///
```

```
public static Curve[] CreateContourCurves(Brep brepToContour, Point3d contourStart, Point3d contourEnd, double interval)
{
return ComputeServer.Post
```(ApiAddress(), brepToContour, contourStart, contourEnd, interval);
}
///
/// Constructs the contour curves for a brep, using a slicing plane.
///
/// A brep or polysurface.
/// A plane.
/// An array with intersected curves. This array can be empty.
public static Curve[] CreateContourCurves(Brep brepToContour, Plane sectionPlane)
{
return ComputeServer.Post(ApiAddress(), brepToContour, sectionPlane);
}
///
/// Constructs all the Wireframe curves for this Brep.
///
/// Wireframe density. Valid values range between -1 and 99.
/// An array of Wireframe curves or null on failure.
public static Curve[] GetWireframe(this Brep brep, int density)
{
return ComputeServer.Post(ApiAddress(), brep, density);
}
///
/// Finds a point on the brep that is closest to testPoint.
///
/// Base point to project to brep.
/// The point on the Brep closest to testPoint or Point3d.Unset if the operation failed.
public static Point3d ClosestPoint(this Brep brep, Point3d testPoint)
{
return ComputeServer.Post(ApiAddress(), brep, testPoint);
}
///
/// Determines if point is inside Brep. This question only makes sense when
/// the brep is a closed manifold. This function does not not check for
/// closed or manifold, so result is not valid in those cases. Intersects
/// a line through point with brep, finds the intersection point Q closest
/// to point, and looks at face normal at Q. If the point Q is on an edge
/// or the intersection is not transverse at Q, then another line is used.
///
/// 3d point to test.
///
/// 3d distance tolerance used for intersection and determining strict inclusion.
/// A good default is RhinoMath.SqrtEpsilon.
///
///
/// if true, point is in if inside brep by at least tolerance.
/// if false, point is in if truly in or within tolerance of boundary.
///
///
/// true if point is in, false if not.
///
public static bool IsPointInside(this Brep brep, Point3d point, double tolerance, bool strictlyIn)
{
return ComputeServer.Post(ApiAddress(), brep, point, tolerance, strictlyIn);
}
///
/// Returns a new Brep that is equivalent to this Brep with all planar holes capped.
///
/// Tolerance to use for capping.
/// New brep on success. null on error.
public static Brep CapPlanarHoles(this Brep brep, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, tolerance);
}
///
/// If any edges of this brep overlap edges of otherBrep, merge a copy of otherBrep into this
/// brep joining all edges that overlap within tolerance.
///
/// Brep to be added to this brep.
/// 3d distance tolerance for detecting overlapping edges.
/// if true, set brep flags and tolerances, remove unused faces and edges.
/// true if any edges were joined.
///
/// if no edges overlap, this brep is unchanged.
/// otherBrep is copied if it is merged with this, and otherBrep is always unchanged
/// Use this to join a list of breps in a series.
/// When joining multiple breps in series, compact should be set to false.
/// Call compact on the last Join.
///
public static bool Join(this Brep brep, out Brep updatedInstance, Brep otherBrep, double tolerance, bool compact)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, otherBrep, tolerance, compact);
}
///
/// Joins naked edge pairs within the same brep that overlap within tolerance.
///
/// The tolerance value.
/// number of joins made.
public static int JoinNakedEdges(this Brep brep, out Brep updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, tolerance);
}
///
/// Merges adjacent coplanar faces into single faces.
///
///
/// Tolerance for determining when edges are adjacent.
/// When in doubt, use the document's ModelAbsoluteTolerance property.
///
/// true if faces were merged, false if no faces were merged.
public static bool MergeCoplanarFaces(this Brep brep, out Brep updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, tolerance);
}
///
/// Merges adjacent coplanar faces into single faces.
///
///
/// Tolerance for determining when edges are adjacent.
/// When in doubt, use the document's ModelAbsoluteTolerance property.
///
///
/// Angle tolerance, in radians, for determining when faces are parallel.
/// When in doubt, use the document's ModelAngleToleranceRadians property.
///
/// true if faces were merged, false if no faces were merged.
public static bool MergeCoplanarFaces(this Brep brep, out Brep updatedInstance, double tolerance, double angleTolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, tolerance, angleTolerance);
}
///
/// Splits a Brep into pieces.
///
/// A splitting surface or polysurface.
/// The tolerance with which to compute intersections.
/// A new array of breps. This array can be empty.
public static Brep[] Split(this Brep brep, Brep splitter, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, splitter, intersectionTolerance);
}
///
/// Splits a Brep into pieces.
///
/// The splitting polysurface.
/// The tolerance with which to compute intersections.
///
/// set to true if the split failed at intersectionTolerance but succeeded
/// when the tolerance was increased to twice intersectionTolerance.
///
/// A new array of breps. This array can be empty.
public static Brep[] Split(this Brep brep, Brep splitter, double intersectionTolerance, out bool toleranceWasRaised)
{
return ComputeServer.Post(ApiAddress(), out toleranceWasRaised, brep, splitter, intersectionTolerance);
}
///
/// Trims a brep with an oriented cutter. The parts of the brep that lie inside
/// (opposite the normal) of the cutter are retained while the parts to the
/// outside (in the direction of the normal) are discarded. If the Cutter is
/// closed, then a connected component of the Brep that does not intersect the
/// cutter is kept if and only if it is contained in the inside of cutter.
/// That is the region bounded by cutter opposite from the normal of cutter,
/// If cutter is not closed all these components are kept.
///
/// A cutting brep.
/// A tolerance value with which to compute intersections.
/// This Brep is not modified, the trim results are returned in an array.
public static Brep[] Trim(this Brep brep, Brep cutter, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, cutter, intersectionTolerance);
}
///
/// Trims a Brep with an oriented cutter. The parts of Brep that lie inside
/// (opposite the normal) of the cutter are retained while the parts to the
/// outside ( in the direction of the normal ) are discarded. A connected
/// component of Brep that does not intersect the cutter is kept if and only
/// if it is contained in the inside of Cutter. That is the region bounded by
/// cutter opposite from the normal of cutter, or in the case of a Plane cutter
/// the halfspace opposite from the plane normal.
///
/// A cutting plane.
/// A tolerance value with which to compute intersections.
/// This Brep is not modified, the trim results are returned in an array.
public static Brep[] Trim(this Brep brep, Plane cutter, double intersectionTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, cutter, intersectionTolerance);
}
///
/// Unjoins, or separates, edges within the Brep. Note, seams in closed surfaces will not separate.
///
/// The indices of the Brep edges to unjoin.
/// This Brep is not modified, the trim results are returned in an array.
public static Brep[] UnjoinEdges(this Brep brep, IEnumerable edgesToUnjoin)
{
return ComputeServer.Post(ApiAddress(), brep, edgesToUnjoin);
}
///
/// Joins two naked edges, or edges that are coincident or close together.
///
/// The first edge index.
/// The second edge index.
/// The join tolerance.
///
/// If joining more than one edge pair and want the edge indices of subsequent pairs to remain valid,
/// set to false. But then call Brep.Compact() on the final result.
///
/// true if successful, false otherwise.
public static bool JoinEdges(this Brep brep, out Brep updatedInstance, int edgeIndex0, int edgeIndex1, double joinTolerance, bool compact)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, edgeIndex0, edgeIndex1, joinTolerance, compact);
}
///
/// Transform an array of Brep components, bend neighbors to match, and leave the rest fixed.
///
/// The Brep components to transform.
/// The transformation to apply.
/// The desired fitting tolerance to use when bending faces that share edges with both fixed and transformed components.
///
/// If the deformation is extreme, it can take a long time to calculate the result.
/// If time_limit > 0, then the value specifies the maximum amount of time in seconds you want to spend before giving up.
///
/// True if multiple threads can be used.
/// true if successful, false otherwise.
public static bool TransformComponent(this Brep brep, out Brep updatedInstance, IEnumerable components, Transform xform, double tolerance, double timeLimit, bool useMultipleThreads)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, components, xform, tolerance, timeLimit, useMultipleThreads);
}
///
/// Compute the Area of the Brep. If you want proper Area data with moments
/// and error information, use the AreaMassProperties class.
///
/// The area of the Brep.
public static double GetArea(this Brep brep)
{
return ComputeServer.Post(ApiAddress(), brep);
}
///
/// Compute the Area of the Brep. If you want proper Area data with moments
/// and error information, use the AreaMassProperties class.
///
/// Relative tolerance to use for area calculation.
/// Absolute tolerance to use for area calculation.
/// The area of the Brep.
public static double GetArea(this Brep brep, double relativeTolerance, double absoluteTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, relativeTolerance, absoluteTolerance);
}
///
/// Compute the Volume of the Brep. If you want proper Volume data with moments
/// and error information, use the VolumeMassProperties class.
///
/// The volume of the Brep.
public static double GetVolume(this Brep brep)
{
return ComputeServer.Post(ApiAddress(), brep);
}
///
/// Compute the Volume of the Brep. If you want proper Volume data with moments
/// and error information, use the VolumeMassProperties class.
///
/// Relative tolerance to use for area calculation.
/// Absolute tolerance to use for area calculation.
/// The volume of the Brep.
public static double GetVolume(this Brep brep, double relativeTolerance, double absoluteTolerance)
{
return ComputeServer.Post(ApiAddress(), brep, relativeTolerance, absoluteTolerance);
}
///
/// No support is available for this function.
/// Expert user function used by MakeValidForV2 to convert trim
/// curves from one surface to its NURBS form. After calling this function,
/// you need to change the surface of the face to a NurbsSurface.
///
///
/// Face whose underlying surface has a parameterization that is different
/// from its NURBS form.
///
/// NURBS form of the face's underlying surface.
///
/// Don't call this function unless you know exactly what you are doing.
///
public static Brep RebuildTrimsForV2(this Brep brep, BrepFace face, NurbsSurface nurbsSurface)
{
return ComputeServer.Post(ApiAddress(), brep, face, nurbsSurface);
}
///
/// No support is available for this function.
/// Expert user function that converts all geometry in brep to nurbs form.
///
///
/// Don't call this function unless you know exactly what you are doing.
///
public static bool MakeValidForV2(this Brep brep, out Brep updatedInstance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep);
}
///
/// Fills in missing or fixes incorrect component information from a Brep.
/// Useful when reading Brep information from other file formats that do not
/// provide as complete of a Brep definition as requried by Rhino.
///
/// The repair tolerance. When in doubt, use the document's model absolute tolerance.
/// True on success.
public static bool Repair(this Brep brep, out Brep updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, brep, tolerance);
}
///
/// Remove all inner loops, or holes, in a Brep.
///
/// The tolerance. When in doubt, use the document's model absolute tolerance.
/// The Brep without holes if successful, null otherwise.
public static Brep RemoveHoles(this Brep brep, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, tolerance);
}
///
/// Removes inner loops, or holes, in a Brep.
///
/// A list of BrepLoop component indexes, where BrepLoop.LoopType == Rhino.Geometry.BrepLoopType.Inner.
/// The tolerance. When in doubt, use the document's model absolute tolerance.
/// The Brep without holes if successful, null otherwise.
public static Brep RemoveHoles(this Brep brep, IEnumerable loops, double tolerance)
{
return ComputeServer.Post(ApiAddress(), brep, loops, tolerance);
}
}
public static class CurveCompute
{
static string ApiAddress([CallerMemberName] string caller = null)
{
return ComputeServer.ApiAddress(typeof(Curve), caller);
}
///
/// Returns the type of conic section based on the curve's shape.
///
///
public static ConicSectionType GetConicSectionType(this Curve curve)
{
return ComputeServer.Post(ApiAddress(), curve);
}
///
/// Interpolates a sequence of points. Used by InterpCurve Command
/// This routine works best when degree=3.
///
/// The degree of the curve >=1. Degree must be odd.
///
/// Points to interpolate (Count must be >= 2)
///
/// interpolated curve on success. null on failure.
public static Curve CreateInterpolatedCurve(IEnumerable points, int degree)
{
return ComputeServer.Post(ApiAddress(), points, degree);
}
///
/// Interpolates a sequence of points. Used by InterpCurve Command
/// This routine works best when degree=3.
///
/// The degree of the curve >=1. Degree must be odd.
///
/// Points to interpolate. For periodic curves if the final point is a
/// duplicate of the initial point it is ignored. (Count must be >=2)
///
///
/// Knot-style to use and specifies if the curve should be periodic.
///
/// interpolated curve on success. null on failure.
public static Curve CreateInterpolatedCurve(IEnumerable points, int degree, CurveKnotStyle knots)
{
return ComputeServer.Post(ApiAddress(), points, degree, knots);
}
///
/// Interpolates a sequence of points. Used by InterpCurve Command
/// This routine works best when degree=3.
///
/// The degree of the curve >=1. Degree must be odd.
///
/// Points to interpolate. For periodic curves if the final point is a
/// duplicate of the initial point it is ignored. (Count must be >=2)
///
///
/// Knot-style to use and specifies if the curve should be periodic.
///
/// A starting tangent.
/// An ending tangent.
/// interpolated curve on success. null on failure.
public static Curve CreateInterpolatedCurve(IEnumerable points, int degree, CurveKnotStyle knots, Vector3d startTangent, Vector3d endTangent)
{
return ComputeServer.Post(ApiAddress(), points, degree, knots, startTangent, endTangent);
}
///
/// Creates a soft edited curve from an exising curve using a smooth field of influence.
///
/// The curve to soft edit.
///
/// A parameter on the curve to move from. This location on the curve is moved, and the move
/// is smoothly tapered off with increasing distance along the curve from this parameter.
///
/// The direction and magitude, or maximum distance, of the move.
///
/// The distance along the curve from the editing point over which the strength
/// of the editing falls off smoothly.
///
///
/// The soft edited curve if successful. null on failure.
public static Curve CreateSoftEditCurve(Curve curve, double t, Vector3d delta, double length, bool fixEnds)
{
return ComputeServer.Post(ApiAddress(), curve, t, delta, length, fixEnds);
}
///
/// Rounds the corners of a kinked curve with arcs of a single, specified radius.
///
/// The curve to fillet.
/// The fillet radius.
/// The tolerance. When in doubt, use the document's model space absolute tolerance.
/// The angle tolerance in radians. When in doubt, use the document's model space angle tolerance.
/// The filleted curve if successful. null on failure.
public static Curve CreateFilletCornersCurve(Curve curve, double radius, double tolerance, double angleTolerance)
{
return ComputeServer.Post(ApiAddress(), curve, radius, tolerance, angleTolerance);
}
///
/// Creates a polycurve consisting of two tangent arc segments that connect two points and two directions.
///
/// Start of the arc blend curve.
/// Start direction of the arc blend curve.
/// End of the arc blend curve.
/// End direction of the arc blend curve.
///
/// The ratio of the control polygon lengths of the two arcs. Note, a value of 1.0
/// means the control polygon lengths for both arcs will be the same.
///
/// The arc blend curve, or null on error.
public static Curve CreateArcBlend(Point3d startPt, Vector3d startDir, Point3d endPt, Vector3d endDir, double controlPointLengthRatio)
{
return ComputeServer.Post(ApiAddress(), startPt, startDir, endPt, endDir, controlPointLengthRatio);
}
///
/// Constructs a mean, or average, curve from two curves.
///
/// A first curve.
/// A second curve.
///
/// The angle tolerance, in radians, used to match kinks between curves.
/// If you are unsure how to set this parameter, then either use the
/// document's angle tolerance RhinoDoc.AngleToleranceRadians,
/// or the default value (RhinoMath.UnsetValue)
///
/// The average curve, or null on error.
/// If curveA or curveB are null.
public static Curve CreateMeanCurve(Curve curveA, Curve curveB, double angleToleranceRadians)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, angleToleranceRadians);
}
///
/// Constructs a mean, or average, curve from two curves.
///
/// A first curve.
/// A second curve.
/// The average curve, or null on error.
/// If curveA or curveB are null.
public static Curve CreateMeanCurve(Curve curveA, Curve curveB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB);
}
///
/// Create a Blend curve between two existing curves.
///
/// Curve to blend from (blending will occur at curve end point).
/// Curve to blend to (blending will occur at curve start point).
/// Continuity of blend.
/// A curve representing the blend between A and B or null on failure.
public static Curve CreateBlendCurve(Curve curveA, Curve curveB, BlendContinuity continuity)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, continuity);
}
///
/// Create a Blend curve between two existing curves.
///
/// Curve to blend from (blending will occur at curve end point).
/// Curve to blend to (blending will occur at curve start point).
/// Continuity of blend.
/// Bulge factor at curveA end of blend. Values near 1.0 work best.
/// Bulge factor at curveB end of blend. Values near 1.0 work best.
/// A curve representing the blend between A and B or null on failure.
public static Curve CreateBlendCurve(Curve curveA, Curve curveB, BlendContinuity continuity, double bulgeA, double bulgeB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, continuity, bulgeA, bulgeB);
}
///
/// Makes a curve blend between 2 curves at the parameters specified
/// with the directions and continuities specified
///
/// First curve to blend from
/// Parameter on first curve for blend endpoint
///
/// If false, the blend will go in the natural direction of the curve.
/// If true, the blend will go in the opposite direction to the curve
///
/// Continuity for the blend at the start
/// Second curve to blend from
/// Parameter on second curve for blend endpoint
///
/// If false, the blend will go in the natural direction of the curve.
/// If true, the blend will go in the opposite direction to the curve
///
/// Continuity for the blend at the end
/// The blend curve on success. null on failure
public static Curve CreateBlendCurve(Curve curve0, double t0, bool reverse0, BlendContinuity continuity0, Curve curve1, double t1, bool reverse1, BlendContinuity continuity1)
{
return ComputeServer.Post(ApiAddress(), curve0, t0, reverse0, continuity0, curve1, t1, reverse1, continuity1);
}
///
/// Creates curves between two open or closed input curves. Uses the control points of the curves for finding tween curves.
/// That means the first control point of first curve is matched to first control point of the second curve and so on.
/// There is no matching of curves direction. Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
/// An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurves(Curve curve0, Curve curve1, int numCurves)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves);
}
///
/// Creates curves between two open or closed input curves. Uses the control points of the curves for finding tween curves.
/// That means the first control point of first curve is matched to first control point of the second curve and so on.
/// There is no matching of curves direction. Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
///
/// An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurves(Curve curve0, Curve curve1, int numCurves, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves, tolerance);
}
///
/// Creates curves between two open or closed input curves. Make the structure of input curves compatible if needed.
/// Refits the input curves to have the same structure. The resulting curves are usually more complex than input unless
/// input curves are compatible and no refit is needed. There is no matching of curves direction.
/// Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
/// An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurvesWithMatching(Curve curve0, Curve curve1, int numCurves)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves);
}
///
/// Creates curves between two open or closed input curves. Make the structure of input curves compatible if needed.
/// Refits the input curves to have the same structure. The resulting curves are usually more complex than input unless
/// input curves are compatible and no refit is needed. There is no matching of curves direction.
/// Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
///
/// An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurvesWithMatching(Curve curve0, Curve curve1, int numCurves, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves, tolerance);
}
///
/// Creates curves between two open or closed input curves. Use sample points method to make curves compatible.
/// This is how the algorithm workd: Divides the two curves into an equal number of points, finds the midpoint between the
/// corresponding points on the curves and interpolates the tween curve through those points. There is no matching of curves
/// direction. Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
/// Number of sample points along input curves.
/// >An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurvesWithSampling(Curve curve0, Curve curve1, int numCurves, int numSamples)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves, numSamples);
}
///
/// Creates curves between two open or closed input curves. Use sample points method to make curves compatible.
/// This is how the algorithm workd: Divides the two curves into an equal number of points, finds the midpoint between the
/// corresponding points on the curves and interpolates the tween curve through those points. There is no matching of curves
/// direction. Caller must match input curves direction before calling the function.
///
/// The first, or starting, curve.
/// The second, or ending, curve.
/// Number of tween curves to create.
/// Number of sample points along input curves.
///
/// >An array of joint curves. This array can be empty.
public static Curve[] CreateTweenCurvesWithSampling(Curve curve0, Curve curve1, int numCurves, int numSamples, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, numCurves, numSamples, tolerance);
}
///
/// Joins a collection of curve segments together.
///
/// Curve segments to join.
/// An array of curves which contains.
public static Curve[] JoinCurves(IEnumerable inputCurves)
{
return ComputeServer.Post(ApiAddress(), inputCurves);
}
///
/// Joins a collection of curve segments together.
///
/// An array, a list or any enumerable set of curve segments to join.
/// Joining tolerance,
/// i.e. the distance between segment end-points that is allowed.
/// An array of joint curves. This array can be empty.
///
/// ```
///
``````
///
``````
///
```

```
///
```If inputCurves is null.
public static Curve[] JoinCurves(IEnumerable inputCurves, double joinTolerance)
{
return ComputeServer.Post(ApiAddress(), inputCurves, joinTolerance);
}
///
/// Joins a collection of curve segments together.
///
/// An array, a list or any enumerable set of curve segments to join.
/// Joining tolerance,
/// i.e. the distance between segment end-points that is allowed.
///
/// If true, curve endpoints will be compared to curve startpoints.
/// If false, all start and endpoints will be compared and copies of input curves may be reversed in output.
///
/// An array of joint curves. This array can be empty.
/// If inputCurves is null.
public static Curve[] JoinCurves(IEnumerable inputCurves, double joinTolerance, bool preserveDirection)
{
return ComputeServer.Post(ApiAddress(), inputCurves, joinTolerance, preserveDirection);
}
///
/// Makes adjustments to the ends of one or both input curves so that they meet at a point.
///
/// 1st curve to adjust.
///
/// Which end of the 1st curve to adjust: true is start, false is end.
///
/// 2nd curve to adjust.
///
/// which end of the 2nd curve to adjust true==start, false==end.
///
/// true on success.
public static bool MakeEndsMeet(Curve curveA, bool adjustStartCurveA, Curve curveB, bool adjustStartCurveB)
{
return ComputeServer.Post(ApiAddress(), curveA, adjustStartCurveA, curveB, adjustStartCurveB);
}
///
/// Computes the fillet arc for a curve filleting operation.
///
/// First curve to fillet.
/// Second curve to fillet.
/// Fillet radius.
/// Parameter on curve0 where the fillet ought to start (approximately).
/// Parameter on curve1 where the fillet ought to end (approximately).
/// The fillet arc on success, or Arc.Unset on failure.
public static Arc CreateFillet(Curve curve0, Curve curve1, double radius, double t0Base, double t1Base)
{
return ComputeServer.Post(ApiAddress(), curve0, curve1, radius, t0Base, t1Base);
}
///
/// Creates a tangent arc between two curves and trims or extends the curves to the arc.
///
/// The first curve to fillet.
///
/// A point on the first curve that is near the end where the fillet will
/// be created.
///
/// The second curve to fillet.
///
/// A point on the second curve that is near the end where the fillet will
/// be created.
///
/// The radius of the fillet.
/// Join the output curves.
///
/// Trim copies of the input curves to the output fillet curve.
///
///
/// Applies when arcs are filleted but need to be extended to meet the
/// fillet curve or chamfer line. If true, then the arc is extended
/// maintaining its validity. If false, then the arc is extended with a
/// line segment, which is joined to the arc converting it to a polycurve.
///
///
/// The tolerance, generally the document's absolute tolerance.
///
///
///
/// The results of the fillet operation. The number of output curves depends
/// on the input curves and the values of the parameters that were used
/// during the fillet operation. In most cases, the output array will contain
/// either one or three curves, although two curves can be returned if the
/// radius is zero and join = false.
/// For example, if both join and trim = true, then the output curve
/// will be a polycurve containing the fillet curve joined with trimmed copies
/// of the input curves. If join = false and trim = true, then three curves,
/// the fillet curve and trimmed copies of the input curves, will be returned.
/// If both join and trim = false, then just the fillet curve is returned.
///
///
/// ```
///
``````
///
``````
///
```

```
public static Curve[] CreateFilletCurves(Curve curve0, Point3d point0, Curve curve1, Point3d point1, double radius, bool join, bool trim, bool arcExtension, double tolerance, double angleTolerance)
{
return ComputeServer.Post
```(ApiAddress(), curve0, point0, curve1, point1, radius, join, trim, arcExtension, tolerance, angleTolerance);
}
///
/// Calculates the boolean union of two or more closed, planar curves.
/// Note, curves must be co-planar.
///
/// The co-planar curves to union.
/// Result curves on success, empty array if no union could be calculated.
public static Curve[] CreateBooleanUnion(IEnumerable curves)
{
return ComputeServer.Post(ApiAddress(), curves);
}
///
/// Calculates the boolean union of two or more closed, planar curves.
/// Note, curves must be co-planar.
///
/// The co-planar curves to union.
///
/// Result curves on success, empty array if no union could be calculated.
public static Curve[] CreateBooleanUnion(IEnumerable curves, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curves, tolerance);
}
///
/// Calculates the boolean intersection of two closed, planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// The second closed, planar curve.
/// Result curves on success, empty array if no intersection could be calculated.
public static Curve[] CreateBooleanIntersection(Curve curveA, Curve curveB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB);
}
///
/// Calculates the boolean intersection of two closed, planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// The second closed, planar curve.
///
/// Result curves on success, empty array if no intersection could be calculated.
public static Curve[] CreateBooleanIntersection(Curve curveA, Curve curveB, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, tolerance);
}
///
/// Calculates the boolean difference between two closed, planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// The second closed, planar curve.
/// Result curves on success, empty array if no difference could be calculated.
public static Curve[] CreateBooleanDifference(Curve curveA, Curve curveB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB);
}
///
/// Calculates the boolean difference between two closed, planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// The second closed, planar curve.
///
/// Result curves on success, empty array if no difference could be calculated.
public static Curve[] CreateBooleanDifference(Curve curveA, Curve curveB, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, tolerance);
}
///
/// Calculates the boolean difference between a closed planar curve, and a list of closed planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// curves to subtract from the first closed curve.
/// Result curves on success, empty array if no difference could be calculated.
public static Curve[] CreateBooleanDifference(Curve curveA, IEnumerable subtractors)
{
return ComputeServer.Post(ApiAddress(), curveA, subtractors);
}
///
/// Calculates the boolean difference between a closed planar curve, and a list of closed planar curves.
/// Note, curves must be co-planar.
///
/// The first closed, planar curve.
/// curves to subtract from the first closed curve.
///
/// Result curves on success, empty array if no difference could be calculated.
public static Curve[] CreateBooleanDifference(Curve curveA, IEnumerable subtractors, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, subtractors, tolerance);
}
///
/// Creates outline curves created from a text string. The functionality is similar to what you find in Rhino's TextObject command or TextEntity.Explode() in RhinoCommon.
///
/// The text from which to create outline curves.
/// The text font.
/// The text height.
/// The font style. The font style can be any number of the following: 0 - Normal, 1 - Bold, 2 - Italic
/// Set this value to True when dealing with normal fonts and when you expect closed loops. You may want to set this to False when specifying a single-stroke font where you don't want closed loops.
/// The plane on which the outline curves will lie.
/// Displays lower-case letters as small caps. Set the relative text size to a percentage of the normal text.
/// The tolerance for the operation.
/// An array containing one or more curves if successful.
public static Curve[] CreateTextOutlines(string text, string font, double textHeight, int textStyle, bool closeLoops, Plane plane, double smallCapsScale, double tolerance)
{
return ComputeServer.Post(ApiAddress(), text, font, textHeight, textStyle, closeLoops, plane, smallCapsScale, tolerance);
}
///
/// Creates a third curve from two curves that are planar in different construction planes.
/// The new curve looks the same as each of the original curves when viewed in each plane.
///
/// The first curve.
/// The second curve.
/// A vector defining the normal direction of the plane which the first curve is drawn upon.
/// A vector defining the normal direction of the plane which the seconf curve is drawn upon.
/// The tolerance for the operation.
/// The angle tolerance for the operation.
/// An array containing one or more curves if successful.
public static Curve[] CreateCurve2View(Curve curveA, Curve curveB, Vector3d vectorA, Vector3d vectorB, double tolerance, double angleTolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, vectorA, vectorB, tolerance, angleTolerance);
}
///
/// Determines whether two curves travel more or less in the same direction.
///
/// First curve to test.
/// Second curve to test.
/// true if both curves more or less point in the same direction,
/// false if they point in the opposite directions.
public static bool DoDirectionsMatch(Curve curveA, Curve curveB)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB);
}
///
/// Projects a curve to a mesh using a direction and tolerance.
///
/// A curve.
/// A mesh.
/// A direction vector.
/// A tolerance value.
/// A curve array.
public static Curve[] ProjectToMesh(Curve curve, Mesh mesh, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, mesh, direction, tolerance);
}
///
/// Projects a curve to a set of meshes using a direction and tolerance.
///
/// A curve.
/// A list, an array or any enumerable of meshes.
/// A direction vector.
/// A tolerance value.
/// A curve array.
public static Curve[] ProjectToMesh(Curve curve, IEnumerable meshes, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, meshes, direction, tolerance);
}
///
/// Projects a curve to a set of meshes using a direction and tolerance.
///
/// A list, an array or any enumerable of curves.
/// A list, an array or any enumerable of meshes.
/// A direction vector.
/// A tolerance value.
/// A curve array.
public static Curve[] ProjectToMesh(IEnumerable curves, IEnumerable meshes, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curves, meshes, direction, tolerance);
}
///
/// Projects a Curve onto a Brep along a given direction.
///
/// Curve to project.
/// Brep to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// An array of projected curves or empty array if the projection set is empty.
public static Curve[] ProjectToBrep(Curve curve, Brep brep, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, brep, direction, tolerance);
}
///
/// Projects a Curve onto a collection of Breps along a given direction.
///
/// Curve to project.
/// Breps to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// An array of projected curves or empty array if the projection set is empty.
public static Curve[] ProjectToBrep(Curve curve, IEnumerable breps, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, breps, direction, tolerance);
}
///
/// Projects a Curve onto a collection of Breps along a given direction.
///
/// Curve to project.
/// Breps to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// (out) Integers that identify for each resulting curve which Brep it was projected onto.
/// An array of projected curves or null if the projection set is empty.
public static Curve[] ProjectToBrep(Curve curve, IEnumerable breps, Vector3d direction, double tolerance, out int[] brepIndices)
{
return ComputeServer.Post(ApiAddress(), out brepIndices, curve, breps, direction, tolerance);
}
///
/// Projects a collection of Curves onto a collection of Breps along a given direction.
///
/// Curves to project.
/// Breps to project onto.
/// Direction of projection.
/// Tolerance to use for projection.
/// An array of projected curves or empty array if the projection set is empty.
public static Curve[] ProjectToBrep(IEnumerable curves, IEnumerable breps, Vector3d direction, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curves, breps, direction, tolerance);
}
///
/// Constructs a curve by projecting an existing curve to a plane.
///
/// A curve.
/// A plane.
/// The projected curve on success; null on failure.
public static Curve ProjectToPlane(Curve curve, Plane plane)
{
return ComputeServer.Post(ApiAddress(), curve, plane);
}
///
/// Pull a curve to a BrepFace using closest point projection.
///
/// Curve to pull.
/// Brepface that pulls.
/// Tolerance to use for pulling.
/// An array of pulled curves, or an empty array on failure.
public static Curve[] PullToBrepFace(Curve curve, BrepFace face, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, face, tolerance);
}
///
/// Determines whether two coplanar simple closed curves are disjoint or intersect;
/// otherwise, if the regions have a containment relationship, discovers
/// which curve encloses the other.
///
/// A first curve.
/// A second curve.
/// A plane.
/// A tolerance value.
///
/// A value indicating the relationship between the first and the second curve.
///
public static RegionContainment PlanarClosedCurveRelationship(Curve curveA, Curve curveB, Plane testPlane, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, testPlane, tolerance);
}
///
/// Determines if two coplanar curves collide (intersect).
///
/// A curve.
/// Another curve.
/// A valid plane containing the curves.
/// A tolerance value for intersection.
/// true if the curves intersect, otherwise false
public static bool PlanarCurveCollision(Curve curveA, Curve curveB, Plane testPlane, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curveA, curveB, testPlane, tolerance);
}
///
/// Polylines will be exploded into line segments. ExplodeCurves will
/// return the curves in topological order.
///
///
/// An array of all the segments that make up this curve.
///
public static Curve[] DuplicateSegments(this Curve curve, out Curve updatedInstance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, curve);
}
///
/// If IsClosed, just return true. Otherwise, decide if curve can be closed as
/// follows: Linear curves polylinear curves with 2 segments, Nurbs with 3 or less
/// control points cannot be made closed. Also, if tolerance > 0 and the gap between
/// start and end is larger than tolerance, curve cannot be made closed.
/// Adjust the curve's endpoint to match its start point.
///
///
/// If nonzero, and the gap is more than tolerance, curve cannot be made closed.
///
/// true on success, false on failure.
public static bool MakeClosed(this Curve curve, out Curve updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, curve, tolerance);
}
///
/// Find parameter of the point on a curve that is locally closest to
/// the testPoint. The search for a local close point starts at
/// a seed parameter.
///
/// A point to test against.
/// The seed parameter.
/// >Parameter of the curve that is closest to testPoint.
/// true if the search is successful, false if the search fails.
public static bool LcoalClosestPoint(this Curve curve, Point3d testPoint, double seed, out double t)
{
return ComputeServer.Post(ApiAddress(), out t, curve, testPoint, seed);
}
///
/// Finds parameter of the point on a curve that is closest to testPoint.
/// If the maximumDistance parameter is > 0, then only points whose distance
/// to the given point is <= maximumDistance will be returned. Using a
/// positive value of maximumDistance can substantially speed up the search.
///
/// Point to search from.
/// Parameter of local closest point.
/// true on success, false on failure.
public static bool ClosestPoint(this Curve curve, Point3d testPoint, out double t)
{
return ComputeServer.Post(ApiAddress(), out t, curve, testPoint);
}
///
/// Finds the parameter of the point on a curve that is closest to testPoint.
/// If the maximumDistance parameter is > 0, then only points whose distance
/// to the given point is <= maximumDistance will be returned. Using a
/// positive value of maximumDistance can substantially speed up the search.
///
/// Point to project.
/// parameter of local closest point returned here.
/// The maximum allowed distance.
/// Past this distance, the search is given up and false is returned.
/// Use 0 to turn off this parameter.
/// true on success, false on failure.
public static bool ClosestPoint(this Curve curve, Point3d testPoint, out double t, double maximumDistance)
{
return ComputeServer.Post(ApiAddress(), out t, curve, testPoint, maximumDistance);
}
///
/// Computes the relationship between a point and a closed curve region.
/// This curve must be closed or the return value will be Unset.
/// Both curve and point are projected to the World XY plane.
///
/// Point to test.
/// Relationship between point and curve region.
public static PointContainment Contains(this Curve curve, Point3d testPoint)
{
return ComputeServer.Post(ApiAddress(), curve, testPoint);
}
///
/// Computes the relationship between a point and a closed curve region.
/// This curve must be closed or the return value will be Unset.
///
/// Point to test.
/// Plane in in which to compare point and region.
/// Relationship between point and curve region.
public static PointContainment Contains(this Curve curve, Point3d testPoint, Plane plane)
{
return ComputeServer.Post(ApiAddress(), curve, testPoint, plane);
}
///
/// Computes the relationship between a point and a closed curve region.
/// This curve must be closed or the return value will be Unset.
///
/// Point to test.
/// Plane in in which to compare point and region.
/// Tolerance to use during comparison.
/// Relationship between point and curve region.
public static PointContainment Contains(this Curve curve, Point3d testPoint, Plane plane, double tolerance)
{
return ComputeServer.Post(ApiAddress(), curve, testPoint, plane, tolerance);
}
///
/// Returns the parameter values of all local extrema.
/// Parameter values are in increasing order so consecutive extrema
/// define an interval on which each component of the curve is monotone.
/// Note, non-periodic curves always return the end points.
///
/// The direction in which to perform the calculation.
/// The parameter values of all local extrema.
public static double[] ExtremeParameters(this Curve curve, Vector3d direction)
{
return ComputeServer.Post(ApiAddress(), curve, direction);
}
///
/// Removes kinks from a curve. Periodic curves deform smoothly without kinks.
///
/// The curve to make periodic. Curve must have degree >= 2.
/// The resulting curve if successful, null otherwise.
public static Curve CreatePeriodicCurve(Curve curve)
{
return ComputeServer.Post(ApiAddress(), curve);
}
///
/// Removes kinks from a curve. Periodic curves deform smoothly without kinks.
///
/// The curve to make periodic. Curve must have degree >= 2.
///
/// If true, smooths any kinks in the curve and moves control points to make a smooth curve.
/// If false, control point locations are not changed or changed minimally (only one point may move) and only the knot vector is altered.
///
/// The resulting curve if successful, null otherwise.
public static Curve CreatePeriodicCurve(Curve curve, bool smooth)
{
return ComputeServer.Post(ApiAddress(), curve, smooth);
}
///
/// Gets a point at a certain length along the curve. The length must be
/// non-negative and less than or equal to the length of the curve.
/// Lengths will not be wrapped when the curve is closed or periodic.
///
/// Length along the curve between the start point and the returned point.
/// Point on the curve at the specified length from the start point or Poin3d.Unset on failure.
///
/// ```
///
``````
///
``````
///
```

```
public static Point3d PointAtLength(this Curve curve, double length)
{
return ComputeServer.Post
```(ApiAddress(), curve, length);
}
///
/// Gets a point at a certain normalized length along the curve. The length must be
/// between or including 0.0 and 1.0, where 0.0 equals the start of the curve and
/// 1.0 equals the end of the curve.
///
/// Normalized length along the curve between the start point and the returned point.
/// Point on the curve at the specified normalized length from the start point or Poin3d.Unset on failure.
public static Point3d PointAtNormalizedLength(this Curve curve, double length)
{
return ComputeServer.Post(ApiAddress(), curve, length);
}
///
/// Return a 3d frame at a parameter. This is slightly different than FrameAt in
/// that the frame is computed in a way so there is minimal rotation from one
/// frame to the next.
///
/// Evaluation parameter.
/// The frame is returned here.
/// true on success, false on failure.
public static bool PerpendicularFrameAt(this Curve curve, double t, out Plane plane)
{
return ComputeServer.Post(ApiAddress(), out plane, curve, t);
}
///
/// Gets a collection of perpendicular frames along the curve. Perpendicular frames
/// are also known as 'Zero-twisting frames' and they minimize rotation from one frame to the next.
///
/// A collection of *strictly increasing* curve parameters to place perpendicular frames on.
/// An array of perpendicular frames on success or null on failure.
/// Thrown when the curve parameters are not increasing.
public static Plane[] GetPerpendicularFrames(this Curve curve, IEnumerable parameters)
{
return ComputeServer.Post(ApiAddress(), curve, parameters);
}
///
/// Gets the length of the curve with a fractional tolerance of 1.0e-8.
///
/// The length of the curve on success, or zero on failure.
///
/// ```
///
``````
///
``````
///
```

```
public static double GetLength(this Curve curve)
{
return ComputeServer.Post
```(ApiAddress(), curve);
}
/// Get the length of the curve.
///
/// Desired fractional precision.
/// fabs(("exact" length from start to t) - arc_length)/arc_length <= fractionalTolerance.
///
/// The length of the curve on success, or zero on failure.
public static double GetLength(this Curve curve, double fractionalTolerance)
{
return ComputeServer.Post(ApiAddress(), curve, fractionalTolerance);
}
/// Get the length of a sub-section of the curve with a fractional tolerance of 1e-8.
///
/// The calculation is performed on the specified sub-domain of the curve (must be non-decreasing).
///
/// The length of the sub-curve on success, or zero on failure.
public static double GetLength(this Curve curve, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), curve, subdomain);
}
/// Get the length of a sub-section of the curve.
///
/// Desired fractional precision.
/// fabs(("exact" length from start to t) - arc_length)/arc_length <= fractionalTolerance.
///
///
/// The calculation is performed on the specified sub-domain of the curve (must be non-decreasing).
///
/// The length of the sub-curve on success, or zero on failure.
public static double GetLength(this Curve curve, double fractionalTolerance, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), curve, fractionalTolerance, subdomain);
}
/// Used to quickly find short curves.
/// Length threshold value for "shortness".
/// true if the length of the curve is <= tolerance.
/// Faster than calling Length() and testing the result.
///
/// ```
///
``````
///
``````
///
```

```
public static bool IsShort(this Curve curve, double tolerance)
{
return ComputeServer.Post
```(ApiAddress(), curve, tolerance);
}
/// Used to quickly find short curves.
/// Length threshold value for "shortness".
///
/// The test is performed on the interval that is the intersection of subdomain with Domain()
///
/// true if the length of the curve is <= tolerance.
/// Faster than calling Length() and testing the result.
public static bool IsShort(this Curve curve, double tolerance, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), curve, tolerance, subdomain);
}
///
/// Looks for segments that are shorter than tolerance that can be removed.
/// Does not change the domain, but it will change the relative parameterization.
///
/// Tolerance which defines "short" segments.
///
/// true if removable short segments were found.
/// false if no removable short segments were found.
///
public static bool RemoveShortSegments(this Curve curve, out Curve updatedInstance, double tolerance)
{
return ComputeServer.Post(ApiAddress(), out updatedInstance, curve, tolerance);
}
///
/// Gets the parameter along the curve which coincides with a given length along the curve.
/// A fractional tolerance of 1e-8 is used in this version of the function.
///
///
/// Length of segment to measure. Must be less than or equal to the length of the curve.
///
///
/// Parameter such that the length of the curve from the curve start point to t equals length.
///
/// true on success, false on failure.
public static bool LengthParameter(this Curve curve, double segmentLength, out double t)
{
return ComputeServer.Post(ApiAddress(), out t, curve, segmentLength);
}
///
/// Gets the parameter along the curve which coincides with a given length along the curve.
///
///
/// Length of segment to measure. Must be less than or equal to the length of the curve.
///
///
/// Parameter such that the length of the curve from the curve start point to t equals s.
///
///
/// Desired fractional precision.
/// fabs(("exact" length from start to t) - arc_length)/arc_length <= fractionalTolerance.
///
/// true on success, false on failure.
public static bool LengthParameter(this Curve curve, double segmentLength, out double t, double fractionalTolerance)
{
return ComputeServer.Post(ApiAddress(), out t, curve, segmentLength, fractionalTolerance);
}
///
/// Gets the parameter along the curve which coincides with a given length along the curve.
/// A fractional tolerance of 1e-8 is used in this version of the function.
///
///
/// Length of segment to measure. Must be less than or equal to the length of the subdomain.
///
///
/// Parameter such that the length of the curve from the start of the subdomain to t is s.
///
///
/// The calculation is performed on the specified sub-domain of the curve rather than the whole curve.
///
/// true on success, false on failure.
public static bool LengthParameter(this Curve curve, double segmentLength, out double t, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), out t, curve, segmentLength, subdomain);
}
///
/// Gets the parameter along the curve which coincides with a given length along the curve.
///
///
/// Length of segment to measure. Must be less than or equal to the length of the subdomain.
///
///
/// Parameter such that the length of the curve from the start of the subdomain to t is s.
///
///
/// Desired fractional precision.
/// fabs(("exact" length from start to t) - arc_length)/arc_length <= fractionalTolerance.
///
///
/// The calculation is performed on the specified sub-domain of the curve rather than the whole curve.
///
/// true on success, false on failure.
public static bool LengthParameter(this Curve curve, double segmentLength, out double t, double fractionalTolerance, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), out t, curve, segmentLength, fractionalTolerance, subdomain);
}
///
/// Input the parameter of the point on the curve that is a prescribed arc length from the start of the curve.
/// A fractional tolerance of 1e-8 is used in this version of the function.
///
///
/// Normalized arc length parameter.
/// E.g., 0 = start of curve, 1/2 = midpoint of curve, 1 = end of curve.
///
///
/// Parameter such that the length of the curve from its start to t is arc_length.
///
/// true on success, false on failure.
public static bool NormalizedLengthParameter(this Curve curve, double s, out double t)
{
return ComputeServer.Post(ApiAddress(), out t, curve, s);
}
///
/// Input the parameter of the point on the curve that is a prescribed arc length from the start of the curve.
///
///
/// Normalized arc length parameter.
/// E.g., 0 = start of curve, 1/2 = midpoint of curve, 1 = end of curve.
///
///
/// Parameter such that the length of the curve from its start to t is arc_length.
///
///
/// Desired fractional precision.
/// fabs(("exact" length from start to t) - arc_length)/arc_length <= fractionalTolerance.
///
/// true on success, false on failure.
public static bool NormalizedLengthParameter(this Curve curve, double s, out double t, double fractionalTolerance)
{
return ComputeServer.Post(ApiAddress(), out t, curve, s, fractionalTolerance);
}
///
/// Input the parameter of the point on the curve that is a prescribed arc length from the start of the curve.
/// A fractional tolerance of 1e-8 is used in this version of the function.
///
///
/// Normalized arc length parameter.
/// E.g., 0 = start of curve, 1/2 = midpoint of curve, 1 = end of curve.
///
///
/// Parameter such that the length of the curve from its start to t is arc_length.
///
///
/// The calculation is performed on the specified sub-domain of the curve.
///
/// true on success, false on failure.
public static bool NormalizedLengthParameter(this Curve curve, double s, out double t, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), out t, curve, s, subdomain);
}
///
/// Input the parameter of the point on the curve that is a prescribed arc length from the start of the curve.
///
///
/// Normalized arc length parameter.
/// E.g., 0 = start of curve, 1/2 = midpoint of curve, 1 = end of curve.
///
///
/// Parameter such that the length of the curve from its start to t is arc_length.
///
///
/// Desired fractional precision.
/// fabs(("exact" length from start to t) - arc_length)/arc_length <= fractionalTolerance.
///
///
/// The calculation is performed on the specified sub-domain of the curve.
///
/// true on success, false on failure.
public static bool NormalizedLengthParameter(this Curve curve, double s, out double t, double fractionalTolerance, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), out t, curve, s, fractionalTolerance, subdomain);
}
///
/// Input the parameter of the point on the curve that is a prescribed arc length from the start of the curve.
/// A fractional tolerance of 1e-8 is used in this version of the function.
///
///
/// Array of normalized arc length parameters.
/// E.g., 0 = start of curve, 1/2 = midpoint of curve, 1 = end of curve.
///
///
/// If absoluteTolerance > 0, then the difference between (s[i+1]-s[i])*curve_length
/// and the length of the curve segment from t[i] to t[i+1] will be <= absoluteTolerance.
///
///
/// If successful, array of curve parameters such that the length of the curve from its start to t[i] is s[i]*curve_length.
/// Null on failure.
///
public static double[] NormalizedLengthParameters(this Curve curve, double[] s, double absoluteTolerance)
{
return ComputeServer.Post(ApiAddress(), curve, s, absoluteTolerance);
}
///
/// Input the parameter of the point on the curve that is a prescribed arc length from the start of the curve.
///
///
/// Array of normalized arc length parameters.
/// E.g., 0 = start of curve, 1/2 = midpoint of curve, 1 = end of curve.
///
///
/// If absoluteTolerance > 0, then the difference between (s[i+1]-s[i])*curve_length
/// and the length of the curve segment from t[i] to t[i+1] will be <= absoluteTolerance.
///
///
/// Desired fractional precision for each segment.
/// fabs("true" length - actual length)/(actual length) <= fractionalTolerance.
///
///
/// If successful, array of curve parameters such that the length of the curve from its start to t[i] is s[i]*curve_length.
/// Null on failure.
///
public static double[] NormalizedLengthParameters(this Curve curve, double[] s, double absoluteTolerance, double fractionalTolerance)
{
return ComputeServer.Post(ApiAddress(), curve, s, absoluteTolerance, fractionalTolerance);
}
///
/// Input the parameter of the point on the curve that is a prescribed arc length from the start of the curve.
/// A fractional tolerance of 1e-8 is used in this version of the function.
///
///
/// Array of normalized arc length parameters.
/// E.g., 0 = start of curve, 1/2 = midpoint of curve, 1 = end of curve.
///
///
/// If absoluteTolerance > 0, then the difference between (s[i+1]-s[i])*curve_length
/// and the length of the curve segment from t[i] to t[i+1] will be <= absoluteTolerance.
///
///
/// The calculation is performed on the specified sub-domain of the curve.
/// A 0.0 s value corresponds to subdomain->Min() and a 1.0 s value corresponds to subdomain->Max().
///
///
/// If successful, array of curve parameters such that the length of the curve from its start to t[i] is s[i]*curve_length.
/// Null on failure.
///
public static double[] NormalizedLengthParameters(this Curve curve, double[] s, double absoluteTolerance, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), curve, s, absoluteTolerance, subdomain);
}
///
/// Input the parameter of the point on the curve that is a prescribed arc length from the start of the curve.
///
///
/// Array of normalized arc length parameters.
/// E.g., 0 = start of curve, 1/2 = midpoint of curve, 1 = end of curve.
///
///
/// If absoluteTolerance > 0, then the difference between (s[i+1]-s[i])*curve_length
/// and the length of the curve segment from t[i] to t[i+1] will be <= absoluteTolerance.
///
///
/// Desired fractional precision for each segment.
/// fabs("true" length - actual length)/(actual length) <= fractionalTolerance.
///
///
/// The calculation is performed on the specified sub-domain of the curve.
/// A 0.0 s value corresponds to subdomain->Min() and a 1.0 s value corresponds to subdomain->Max().
///
///
/// If successful, array of curve parameters such that the length of the curve from its start to t[i] is s[i]*curve_length.
/// Null on failure.
///
public static double[] NormalizedLengthParameters(this Curve curve, double[] s, double absoluteTolerance, double fractionalTolerance, Interval subdomain)
{
return ComputeServer.Post(ApiAddress(), curve, s, absoluteTolerance, fractionalTolerance, subdomain);
}
///
/// Divide the curve into a number of equal-length segments.
///
/// Segment count. Note that the number of division points may differ from the segment count.
/// If true, then the point at the start of the first division segment is returned.
///
/// List of curve parameters at the division points on success, null on failure.
///
public static double[] DivideByCount(this Curve curve, int segmentCount, bool includeEnds)
{
return ComputeServer.Post(ApiAddress(), curve, segmentCount, includeEnds);
}
///