Table of Contents

Method TrySplitBy

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

TrySplitBy(GeoLine3, GeoPoint3, out GeoLine3[])

Splits a line segment at a point on it, using the default tolerance.

public static bool TrySplitBy(GeoLine3 line, GeoPoint3 point, out GeoLine3[] pieces)

Parameters

line GeoLine3
point GeoPoint3
pieces GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoPoint3, out GeoLine3[], Tolerance)

Splits a line segment at a point on it, within a tolerance.

public static bool TrySplitBy(GeoLine3 line, GeoPoint3 point, out GeoLine3[] pieces, Tolerance tolerance)

Parameters

line GeoLine3
point GeoPoint3
pieces GeoLine3[]
tolerance Tolerance

Returns

bool

false when the point does not lie on the segment, or lies on one of its endpoints.

Remarks

A point off the subject is refused rather than being projected onto it and cut at, because a caller who passed the wrong point would otherwise get a plausible answer to a question they did not ask.

TrySplitBy(GeoLine3, GeoPlane3, out GeoLine3[])

Splits a line segment where a plane crosses it, using the default tolerance.

public static bool TrySplitBy(GeoLine3 line, GeoPlane3 cutter, out GeoLine3[] pieces)

Parameters

line GeoLine3
cutter GeoPlane3
pieces GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoPlane3, out GeoLine3[], Tolerance)

Splits a line segment where a plane crosses it, within a tolerance.

public static bool TrySplitBy(GeoLine3 line, GeoPlane3 cutter, out GeoLine3[] pieces, Tolerance tolerance)

Parameters

line GeoLine3
cutter GeoPlane3
pieces GeoLine3[]
tolerance Tolerance

Returns

bool

Remarks

The pieces come back in order along the segment, so which side each one is on follows from where the segment started. A segment lying in the plane is not cut, for the same reason Intersection3 refuses it: every point of it would be a cut.

TrySplitBy(GeoPolyline3, GeoPoint3, out GeoPolyline3[])

Splits a polyline at a point on it, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 polyline, GeoPoint3 point, out GeoPolyline3[] pieces)

Parameters

polyline GeoPolyline3
point GeoPoint3
pieces GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoPoint3, out GeoPolyline3[], Tolerance)

Splits a polyline at a point on it, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 polyline, GeoPoint3 point, out GeoPolyline3[] pieces, Tolerance tolerance)

Parameters

polyline GeoPolyline3
point GeoPoint3
pieces GeoPolyline3[]
tolerance Tolerance

Returns

bool

TrySplitBy(GeoPolyline3, GeoPlane3, out GeoPolyline3[])

Splits a polyline wherever a plane crosses it, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 polyline, GeoPlane3 cutter, out GeoPolyline3[] pieces)

Parameters

polyline GeoPolyline3
cutter GeoPlane3
pieces GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoPlane3, out GeoPolyline3[], Tolerance)

Splits a polyline wherever a plane crosses it, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 polyline, GeoPlane3 cutter, out GeoPolyline3[] pieces, Tolerance tolerance)

Parameters

polyline GeoPolyline3
cutter GeoPlane3
pieces GeoPolyline3[]
tolerance Tolerance

Returns

bool

Remarks

A chain can cross the same plane several times, so every crossing is cut at and the pieces come back in order along the chain, alternating sides.

TrySplitBy(GeoPolygon3, GeoPlane3, out GeoPolygon3[], out GeoPolygon3[])

Splits a polygon by a plane, using the default tolerance.

public static bool TrySplitBy(GeoPolygon3 polygon, GeoPlane3 cutter, out GeoPolygon3[] above, out GeoPolygon3[] below)

Parameters

polygon GeoPolygon3
cutter GeoPlane3
above GeoPolygon3[]
below GeoPolygon3[]

Returns

bool

TrySplitBy(GeoPolygon3, GeoPlane3, out GeoPolygon3[], out GeoPolygon3[], Tolerance)

Splits a polygon by a plane, within a tolerance.

public static bool TrySplitBy(GeoPolygon3 polygon, GeoPlane3 cutter, out GeoPolygon3[] above, out GeoPolygon3[] below, Tolerance tolerance)

Parameters

polygon GeoPolygon3

The polygon to cut.

cutter GeoPlane3

The cutting plane.

above GeoPolygon3[]

The pieces on the side the cutter normal points towards.

below GeoPolygon3[]

The pieces on the other side.

tolerance Tolerance

The tolerance.

Returns

bool

false when the plane does not cut the polygon into two.

Remarks

Every piece keeps the orientation of the subject, so each one reports the same normal the original did. A concave polygon can fall into more than two pieces — a plane through the waist of a U leaves one piece on one side and two on the other — which is why each side comes back as an array rather than a single polygon.

When the method returns false the subject is handed back whole on whichever side it lies, and the other side comes back empty.

TrySplitBy(GeoFace3, GeoPlane3, out GeoFace3[], out GeoFace3[])

Splits a face by a plane, using the default tolerance.

public static bool TrySplitBy(GeoFace3 face, GeoPlane3 cutter, out GeoFace3[] above, out GeoFace3[] below)

Parameters

face GeoFace3
cutter GeoPlane3
above GeoFace3[]
below GeoFace3[]

Returns

bool

TrySplitBy(GeoFace3, GeoPlane3, out GeoFace3[], out GeoFace3[], Tolerance)

Splits a face by a plane, within a tolerance.

public static bool TrySplitBy(GeoFace3 face, GeoPlane3 cutter, out GeoFace3[] above, out GeoFace3[] below, Tolerance tolerance)

Parameters

face GeoFace3

The face to cut, holes included.

cutter GeoPlane3

The cutting plane.

above GeoFace3[]

The pieces on the side the cutter normal points towards.

below GeoFace3[]

The pieces on the other side.

tolerance Tolerance

The tolerance.

Returns

bool

false when the plane does not cut the face into two.

Remarks

The holes are cut along with the boundary rather than being sorted onto one side afterwards. That matters when the plane passes through a hole: the piece on each side then has a boundary made partly of the old outer edge and partly of the old hole rim, so the topology changes and no amount of sorting whole holes would produce it. A hole the plane misses stays a hole, and is attached to whichever piece encloses it.

TrySplitBy(GeoSolid3, GeoPlane3, out GeoSolid3, out GeoSolid3)

Splits a solid by a plane, using the default tolerance.

public static bool TrySplitBy(GeoSolid3 solid, GeoPlane3 cutter, out GeoSolid3 above, out GeoSolid3 below)

Parameters

solid GeoSolid3
cutter GeoPlane3
above GeoSolid3
below GeoSolid3

Returns

bool

TrySplitBy(GeoSolid3, GeoPlane3, out GeoSolid3, out GeoSolid3, Tolerance)

Splits a solid by a plane, within a tolerance.

public static bool TrySplitBy(GeoSolid3 solid, GeoPlane3 cutter, out GeoSolid3 above, out GeoSolid3 below, Tolerance tolerance)

Parameters

solid GeoSolid3

The solid to cut; its boundary must be closed and wound outwards.

cutter GeoPlane3

The cutting plane.

above GeoSolid3

The piece on the side the cutter normal points towards.

below GeoSolid3

The piece on the other side.

tolerance Tolerance

The tolerance.

Returns

bool

false when the plane misses the solid or only grazes it.

Remarks

The body may be concave and its faces may carry holes. Each face is cut on its own, and the new surface closing each half is built from the edges the cut left behind: every such edge is traversed once by the face beside it, so the same edge traversed the other way belongs to the cap. Chaining those reversed edges gives the section, which may be several loops and may have one loop inside another — cutting a hollow tube leaves a ring, not a disc — so the loops are nested into faces rather than assumed to be a single boundary.

An edge shared by two faces that both survive on the same side is traversed both ways among the collected edges and cancels out, which is what keeps interior edges from being mistaken for section boundary.

TrySplitBy(GeoPolyline3, GeoSolid3, out GeoPolyline3[], out GeoPolyline3[])

Splits a polyline by a solid, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoSolid3 cutter, out GeoPolyline3[] inside, out GeoPolyline3[] outside)

Parameters

subject GeoPolyline3
cutter GeoSolid3
inside GeoPolyline3[]
outside GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoSolid3, out GeoPolyline3[], out GeoPolyline3[], Tolerance)

Splits a polyline by a solid, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoSolid3 cutter, out GeoPolyline3[] inside, out GeoPolyline3[] outside, Tolerance tolerance)

Parameters

subject GeoPolyline3

The chain to cut.

cutter GeoSolid3

The body to cut it by; its boundary must be closed.

inside GeoPolyline3[]

The pieces lying within the body.

outside GeoPolyline3[]

The pieces lying beyond it.

tolerance Tolerance

The tolerance.

Returns

bool

false when the chain never crosses the surface, so there was nothing to cut.

Remarks

A closed body has no side the way a plane does, so the pieces come back sorted into within and beyond rather than above and below. The chain is cut at every crossing of the surface, which is what makes each piece lie wholly on one side and lets a single sample decide which.

A piece lying on the surface counts as inside, following Containment3.Contains, which reads the boundary as part of the body. A chain running along a face is therefore reported as inside along its whole length.

The body is assumed closed, as Containment3.Locate assumes it: an open shell has no inside and the answer means nothing. That is not checked here, because checking costs a pass over every edge of the body on every call; ask IsClosed() once instead.

TrySplitBy(GeoLine3, GeoSolid3, out GeoLine3[], out GeoLine3[])

Splits a line segment by a solid, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoSolid3 cutter, out GeoLine3[] inside, out GeoLine3[] outside)

Parameters

subject GeoLine3
cutter GeoSolid3
inside GeoLine3[]
outside GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoSolid3, out GeoLine3[], out GeoLine3[], Tolerance)

Splits a line segment by a solid, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoSolid3 cutter, out GeoLine3[] inside, out GeoLine3[] outside, Tolerance tolerance)

Parameters

subject GeoLine3
cutter GeoSolid3
inside GeoLine3[]
outside GeoLine3[]
tolerance Tolerance

Returns

bool

TrySplitBy(GeoPolyline3, GeoSolid3[], out GeoPolyline3[], out GeoPolyline3[])

Splits a polyline by several solids at once, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoSolid3[] cutters, out GeoPolyline3[] inside, out GeoPolyline3[] outside)

Parameters

subject GeoPolyline3
cutters GeoSolid3[]
inside GeoPolyline3[]
outside GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoSolid3[], out GeoPolyline3[], out GeoPolyline3[], Tolerance)

Splits a polyline by several solids at once, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoSolid3[] cutters, out GeoPolyline3[] inside, out GeoPolyline3[] outside, Tolerance tolerance)

Parameters

subject GeoPolyline3

The chain to cut.

cutters GeoSolid3[]

The bodies to cut it by; null entries are skipped.

inside GeoPolyline3[]

The pieces lying within at least one of the bodies.

outside GeoPolyline3[]

The pieces lying beyond all of them.

tolerance Tolerance

The tolerance.

Returns

bool

false when the chain crosses no surface, so there was nothing to cut.

Remarks

The bodies act as their union: a stretch counts as inside when any one of them holds it. That is what separates this from cutting by each in turn, where the pieces of the first cut would have to be sorted again against the second and the runs joined back up by hand.

Because the union is what is being asked about, two bodies that overlap do not each claim their own piece of the answer, and two that meet face to face do not leave a cut between them: the stretch running through both comes back as one piece, since a cut that separates nothing is not a cut. An empty array is the degenerate case of the same rule — nothing holds anything, so the whole chain is outside.

Every body is assumed closed, as Containment3.Locate assumes it. That is not checked here, because checking costs a pass over every edge of every body on every call; ask IsClosed() once instead.

TrySplitBy(GeoLine3, GeoSolid3[], out GeoLine3[], out GeoLine3[])

Splits a line segment by several solids at once, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoSolid3[] cutters, out GeoLine3[] inside, out GeoLine3[] outside)

Parameters

subject GeoLine3
cutters GeoSolid3[]
inside GeoLine3[]
outside GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoSolid3[], out GeoLine3[], out GeoLine3[], Tolerance)

Splits a line segment by several solids at once, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoSolid3[] cutters, out GeoLine3[] inside, out GeoLine3[] outside, Tolerance tolerance)

Parameters

subject GeoLine3

The segment to cut.

cutters GeoSolid3[]

The bodies to cut it by; null entries are skipped.

inside GeoLine3[]

The pieces lying within at least one of the bodies.

outside GeoLine3[]

The pieces lying beyond all of them.

tolerance Tolerance

The tolerance.

Returns

bool

false when the segment crosses no surface, so there was nothing to cut.

Remarks

The bodies act as their union, exactly as in the polyline overload above.

TrySplitBy(GeoPolyline3, GeoObb3, out GeoPolyline3[], out GeoPolyline3[])

Splits a polyline by an oriented box, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoObb3 cutter, out GeoPolyline3[] inside, out GeoPolyline3[] outside)

Parameters

subject GeoPolyline3
cutter GeoObb3
inside GeoPolyline3[]
outside GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoObb3, out GeoPolyline3[], out GeoPolyline3[], Tolerance)

Splits a polyline by an oriented box, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoObb3 cutter, out GeoPolyline3[] inside, out GeoPolyline3[] outside, Tolerance tolerance)

Parameters

subject GeoPolyline3
cutter GeoObb3
inside GeoPolyline3[]
outside GeoPolyline3[]
tolerance Tolerance

Returns

bool

Remarks

A box is a closed body like any other, but a far cheaper one to cross-check: the crossings come from the slab test rather than from walking a surface, so this does not build or traverse a mesh.

TrySplitBy(GeoLine3, GeoObb3, out GeoLine3[], out GeoLine3[])

Splits a line segment by an oriented box, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoObb3 cutter, out GeoLine3[] inside, out GeoLine3[] outside)

Parameters

subject GeoLine3
cutter GeoObb3
inside GeoLine3[]
outside GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoObb3, out GeoLine3[], out GeoLine3[], Tolerance)

Splits a line segment by an oriented box, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoObb3 cutter, out GeoLine3[] inside, out GeoLine3[] outside, Tolerance tolerance)

Parameters

subject GeoLine3
cutter GeoObb3
inside GeoLine3[]
outside GeoLine3[]
tolerance Tolerance

Returns

bool

TrySplitBy(GeoPolyline3, GeoAabb3, out GeoPolyline3[], out GeoPolyline3[])

Splits a polyline by an axis-aligned box, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoAabb3 cutter, out GeoPolyline3[] inside, out GeoPolyline3[] outside)

Parameters

subject GeoPolyline3
cutter GeoAabb3
inside GeoPolyline3[]
outside GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoAabb3, out GeoPolyline3[], out GeoPolyline3[], Tolerance)

Splits a polyline by an axis-aligned box, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoAabb3 cutter, out GeoPolyline3[] inside, out GeoPolyline3[] outside, Tolerance tolerance)

Parameters

subject GeoPolyline3
cutter GeoAabb3
inside GeoPolyline3[]
outside GeoPolyline3[]
tolerance Tolerance

Returns

bool

Remarks

An empty box holds nothing, so there is nothing to cut and the whole chain comes back as outside.

TrySplitBy(GeoLine3, GeoAabb3, out GeoLine3[], out GeoLine3[])

Splits a line segment by an axis-aligned box, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoAabb3 cutter, out GeoLine3[] inside, out GeoLine3[] outside)

Parameters

subject GeoLine3
cutter GeoAabb3
inside GeoLine3[]
outside GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoAabb3, out GeoLine3[], out GeoLine3[], Tolerance)

Splits a line segment by an axis-aligned box, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoAabb3 cutter, out GeoLine3[] inside, out GeoLine3[] outside, Tolerance tolerance)

Parameters

subject GeoLine3
cutter GeoAabb3
inside GeoLine3[]
outside GeoLine3[]
tolerance Tolerance

Returns

bool

TrySplitBy(GeoPolyline3, GeoObb3[], out GeoPolyline3[], out GeoPolyline3[])

Splits a polyline by several oriented boxes at once, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoObb3[] cutters, out GeoPolyline3[] inside, out GeoPolyline3[] outside)

Parameters

subject GeoPolyline3
cutters GeoObb3[]
inside GeoPolyline3[]
outside GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoObb3[], out GeoPolyline3[], out GeoPolyline3[], Tolerance)

Splits a polyline by several oriented boxes at once, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoObb3[] cutters, out GeoPolyline3[] inside, out GeoPolyline3[] outside, Tolerance tolerance)

Parameters

subject GeoPolyline3

The chain to cut.

cutters GeoObb3[]

The boxes to cut it by; null entries are skipped.

inside GeoPolyline3[]

The pieces lying within at least one of the boxes.

outside GeoPolyline3[]

The pieces lying beyond all of them.

tolerance Tolerance

The tolerance.

Returns

bool

false when the chain crosses no box, so there was nothing to cut.

Remarks

The boxes act as their union, exactly as several solids do, and for the same reason: cutting by each in turn would leave the caller to sort the pieces of the first cut against the second and to join the runs back up by hand.

A box is far cheaper to cross-check than a solid, because the crossings come from the slab test rather than from walking a surface, so no mesh is built or traversed here.

TrySplitBy(GeoLine3, GeoObb3[], out GeoLine3[], out GeoLine3[])

Splits a line segment by several oriented boxes at once, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoObb3[] cutters, out GeoLine3[] inside, out GeoLine3[] outside)

Parameters

subject GeoLine3
cutters GeoObb3[]
inside GeoLine3[]
outside GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoObb3[], out GeoLine3[], out GeoLine3[], Tolerance)

Splits a line segment by several oriented boxes at once, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoObb3[] cutters, out GeoLine3[] inside, out GeoLine3[] outside, Tolerance tolerance)

Parameters

subject GeoLine3

The segment to cut.

cutters GeoObb3[]

The boxes to cut it by; null entries are skipped.

inside GeoLine3[]

The pieces lying within at least one of the boxes.

outside GeoLine3[]

The pieces lying beyond all of them.

tolerance Tolerance

The tolerance.

Returns

bool

false when the segment crosses no box, so there was nothing to cut.

Remarks

The boxes act as their union, exactly as in the polyline overload above.

TrySplitBy(GeoPolyline3, GeoAabb3[], out GeoPolyline3[], out GeoPolyline3[])

Splits a polyline by several axis-aligned boxes at once, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoAabb3[] cutters, out GeoPolyline3[] inside, out GeoPolyline3[] outside)

Parameters

subject GeoPolyline3
cutters GeoAabb3[]
inside GeoPolyline3[]
outside GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoAabb3[], out GeoPolyline3[], out GeoPolyline3[], Tolerance)

Splits a polyline by several axis-aligned boxes at once, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoAabb3[] cutters, out GeoPolyline3[] inside, out GeoPolyline3[] outside, Tolerance tolerance)

Parameters

subject GeoPolyline3

The chain to cut.

cutters GeoAabb3[]

The boxes to cut it by; empty boxes are skipped.

inside GeoPolyline3[]

The pieces lying within at least one of the boxes.

outside GeoPolyline3[]

The pieces lying beyond all of them.

tolerance Tolerance

The tolerance.

Returns

bool

false when the chain crosses no box, so there was nothing to cut.

Remarks

The boxes act as their union, exactly as several solids do. An axis-aligned box is a value rather than a reference, so there are no null entries to skip here; what takes their place is the empty box, which holds nothing and so can be left out before the work starts.

TrySplitBy(GeoLine3, GeoAabb3[], out GeoLine3[], out GeoLine3[])

Splits a line segment by several axis-aligned boxes at once, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoAabb3[] cutters, out GeoLine3[] inside, out GeoLine3[] outside)

Parameters

subject GeoLine3
cutters GeoAabb3[]
inside GeoLine3[]
outside GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoAabb3[], out GeoLine3[], out GeoLine3[], Tolerance)

Splits a line segment by several axis-aligned boxes at once, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoAabb3[] cutters, out GeoLine3[] inside, out GeoLine3[] outside, Tolerance tolerance)

Parameters

subject GeoLine3

The segment to cut.

cutters GeoAabb3[]

The boxes to cut it by; empty boxes are skipped.

inside GeoLine3[]

The pieces lying within at least one of the boxes.

outside GeoLine3[]

The pieces lying beyond all of them.

tolerance Tolerance

The tolerance.

Returns

bool

false when the segment crosses no box, so there was nothing to cut.

Remarks

The boxes act as their union, exactly as in the polyline overload above.

TrySplitBy(GeoPolyline3, GeoPlane3, out GeoPolyline3[], out GeoPolyline3[])

Splits a polyline by a plane and sorts the pieces by side, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoPlane3 cutter, out GeoPolyline3[] above, out GeoPolyline3[] below)

Parameters

subject GeoPolyline3
cutter GeoPlane3
above GeoPolyline3[]
below GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoPlane3, out GeoPolyline3[], out GeoPolyline3[], Tolerance)

Splits a polyline by a plane and sorts the pieces by side, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoPlane3 cutter, out GeoPolyline3[] above, out GeoPolyline3[] below, Tolerance tolerance)

Parameters

subject GeoPolyline3

The chain to cut.

cutter GeoPlane3

The cutting plane.

above GeoPolyline3[]

The pieces on the side the cutter normal points towards.

below GeoPolyline3[]

The pieces on the other side.

tolerance Tolerance

The tolerance.

Returns

bool

false when the chain stays on one side, so there was nothing to cut.

Remarks

This is the same cut as the overload that hands back the pieces in order along the chain; what differs is how the result is presented. Use that one to divide a chain up, and this one to keep or discard a side.

A stretch lying in the cutting plane goes with above, so that side reads as "not strictly below". That follows the convention the rest of the library keeps, where Contains means "not strictly outside" and a piece on a surface counts as inside it.

Neighbouring pieces that end up on the same side are joined back together, so what comes out is the longest run on each side rather than a chain chopped at positions that separate nothing.

TrySplitBy(GeoLine3, GeoPlane3, out GeoLine3[], out GeoLine3[])

Splits a line segment by a plane and sorts the pieces by side, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoPlane3 cutter, out GeoLine3[] above, out GeoLine3[] below)

Parameters

subject GeoLine3
cutter GeoPlane3
above GeoLine3[]
below GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoPlane3, out GeoLine3[], out GeoLine3[], Tolerance)

Splits a line segment by a plane and sorts the pieces by side, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoPlane3 cutter, out GeoLine3[] above, out GeoLine3[] below, Tolerance tolerance)

Parameters

subject GeoLine3
cutter GeoPlane3
above GeoLine3[]
below GeoLine3[]
tolerance Tolerance

Returns

bool

TrySplitBy(GeoPolyline3, GeoPolygon3, out GeoPolyline3[])

Splits a polyline wherever it passes through a polygon, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoPolygon3 cutter, out GeoPolyline3[] pieces)

Parameters

subject GeoPolyline3
cutter GeoPolygon3
pieces GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoPolygon3, out GeoPolyline3[], Tolerance)

Splits a polyline wherever it passes through a polygon, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoPolygon3 cutter, out GeoPolyline3[] pieces, Tolerance tolerance)

Parameters

subject GeoPolyline3

The chain to cut.

cutter GeoPolygon3

The region to cut it with.

pieces GeoPolyline3[]

The pieces, in order along the chain.

tolerance Tolerance

The tolerance.

Returns

bool

false when the chain never passes through the region.

Remarks

A bounded region is not the plane that carries it. This cuts only where the chain actually goes through the region, so a chain that crosses the carrying plane out beyond the outline is left alone — which is what is wanted when the cutter stands for a physical plate rather than for an endless surface. Cut against GeoPlane3 instead to get the other reading.

The pieces come back in order along the chain rather than sorted, because a bounded region has no side to sort them onto: a chain can pass through it and come back without ever having been anywhere the region divides.

TrySplitBy(GeoPolyline3, GeoFace3, out GeoPolyline3[])

Splits a polyline wherever it passes through a face, using the default tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoFace3 cutter, out GeoPolyline3[] pieces)

Parameters

subject GeoPolyline3
cutter GeoFace3
pieces GeoPolyline3[]

Returns

bool

TrySplitBy(GeoPolyline3, GeoFace3, out GeoPolyline3[], Tolerance)

Splits a polyline wherever it passes through a face, within a tolerance.

public static bool TrySplitBy(GeoPolyline3 subject, GeoFace3 cutter, out GeoPolyline3[] pieces, Tolerance tolerance)

Parameters

subject GeoPolyline3
cutter GeoFace3
pieces GeoPolyline3[]
tolerance Tolerance

Returns

bool

Remarks

The holes in the face are respected: a chain threading through a hole passes through nothing and is not cut there.

TrySplitBy(GeoLine3, GeoPolygon3, out GeoLine3[])

Splits a line segment wherever it passes through a polygon, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoPolygon3 cutter, out GeoLine3[] pieces)

Parameters

subject GeoLine3
cutter GeoPolygon3
pieces GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoPolygon3, out GeoLine3[], Tolerance)

Splits a line segment wherever it passes through a polygon, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoPolygon3 cutter, out GeoLine3[] pieces, Tolerance tolerance)

Parameters

subject GeoLine3
cutter GeoPolygon3
pieces GeoLine3[]
tolerance Tolerance

Returns

bool

TrySplitBy(GeoLine3, GeoFace3, out GeoLine3[])

Splits a line segment wherever it passes through a face, using the default tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoFace3 cutter, out GeoLine3[] pieces)

Parameters

subject GeoLine3
cutter GeoFace3
pieces GeoLine3[]

Returns

bool

TrySplitBy(GeoLine3, GeoFace3, out GeoLine3[], Tolerance)

Splits a line segment wherever it passes through a face, within a tolerance.

public static bool TrySplitBy(GeoLine3 subject, GeoFace3 cutter, out GeoLine3[] pieces, Tolerance tolerance)

Parameters

subject GeoLine3
cutter GeoFace3
pieces GeoLine3[]
tolerance Tolerance

Returns

bool

TrySplitBy(GeoPolygon3, GeoPolyline3, out GeoPolygon3[])

Splits a polygon along a chain drawn across it, using the default tolerance.

public static bool TrySplitBy(GeoPolygon3 subject, GeoPolyline3 cutLine, out GeoPolygon3[] pieces)

Parameters

subject GeoPolygon3
cutLine GeoPolyline3
pieces GeoPolygon3[]

Returns

bool

TrySplitBy(GeoPolygon3, GeoPolyline3, out GeoPolygon3[], Tolerance)

Splits a polygon along a chain drawn across it, within a tolerance.

public static bool TrySplitBy(GeoPolygon3 subject, GeoPolyline3 cutLine, out GeoPolygon3[] pieces, Tolerance tolerance)

Parameters

subject GeoPolygon3

The region to cut.

cutLine GeoPolyline3

The chain to cut along.

pieces GeoPolygon3[]

The two pieces the chain divides the region into.

tolerance Tolerance

The tolerance.

Returns

bool

false when the chain does not divide the region in two.

Remarks

This is cutting a plate along a line marked on it. The chain has to lie in the plane of the region, start and finish on its outline, and stay inside in between — anything else does not separate the region into two and is refused rather than answered.

Each piece is bounded by part of the original outline and by the chain, so the two pieces share the chain as their common edge and their outlines together cover the original. Both keep the orientation of the subject.

A chain that wanders back out of the region and in again would cut it into more than two, which needs the crossings paired up the way a plane cut pairs them; that is not attempted here.

TrySplitBy(GeoPolygon3, GeoSolid3, out GeoPolygon3[], out GeoPolygon3[])

Splits a polygon by a solid, using the default tolerance.

public static bool TrySplitBy(GeoPolygon3 subject, GeoSolid3 cutter, out GeoPolygon3[] inside, out GeoPolygon3[] outside)

Parameters

subject GeoPolygon3
cutter GeoSolid3
inside GeoPolygon3[]
outside GeoPolygon3[]

Returns

bool

TrySplitBy(GeoPolygon3, GeoSolid3, out GeoPolygon3[], out GeoPolygon3[], Tolerance)

Splits a polygon by a solid, within a tolerance.

public static bool TrySplitBy(GeoPolygon3 subject, GeoSolid3 cutter, out GeoPolygon3[] inside, out GeoPolygon3[] outside, Tolerance tolerance)

Parameters

subject GeoPolygon3

The region to cut.

cutter GeoSolid3

The body to cut it by; its boundary must be closed.

inside GeoPolygon3[]

The pieces lying within the body.

outside GeoPolygon3[]

The pieces lying beyond it.

tolerance Tolerance

The tolerance.

Returns

bool

false when the body does not divide the region.

Remarks

This answers which part of a plate is embedded in a body and which part stands clear of it.

The region is cut by the plane of each face of the body in turn. That works because the surface of the body never leaves those planes, so once the region has been cut by all of them no piece can straddle the boundary, and a single sample decides each piece. The pieces are then joined back up where they agree.

Cutting by every plane divides the region more finely than the body itself does, and joining the pieces afterwards recovers most but not always all of that: two pieces that ended up split by different planes can meet at a T-junction, which nothing joins. What comes back therefore covers each side exactly, but may be in more pieces than strictly necessary.

A body with many faces means many cuts, so this is meant for cutting a plate against a member, not against a whole model. Planes that miss the region cost almost nothing, since a cut that separates nothing is rejected before any work is done.