Method Locate
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
Locate(GeoTriangle3, GeoPoint3)
Locates a point relative to a triangle, using the default tolerance.
public static PointLocation Locate(GeoTriangle3 triangle, GeoPoint3 point)
Parameters
triangleGeoTriangle3pointGeoPoint3
Returns
Locate(GeoTriangle3, GeoPoint3, Tolerance)
Locates a point relative to a triangle, within a tolerance.
public static PointLocation Locate(GeoTriangle3 triangle, GeoPoint3 point, Tolerance tolerance)
Parameters
triangleGeoTriangle3The triangle.
pointGeoPoint3The point to locate.
toleranceToleranceThe tolerance.
Returns
- PointLocation
Inside when the point lies on the triangle away from its edges, OnSide when it lies on an edge, and OutSide otherwise.
Remarks
A triangle is a planar region, so a point counts as inside only when it lies on the carrier plane as well as within the edges: a point hovering above the middle of a triangle is outside it. A triangle with no area, by IsDegenerate(Tolerance), has no interior: it is the segment it has collapsed to, and a point within the point tolerance of one of its sides is on it, the rest outside. The centroid of the triangle 0.003 by 0.003 is on it at the default tolerance, 0.001 from two of its sides, where it was outside, and so is the middle of the sliver 100 long and 1E-8 high. The area is read at the tolerance given: at 1E-5 the triangle 100 long and 0.0005 high holds (50, 0.0002, 0) inside it, though it has no area at the default.
Locate(GeoPolygon3, GeoPoint3)
Locates a point relative to a polygon, using the default tolerance.
public static PointLocation Locate(GeoPolygon3 polygon, GeoPoint3 point)
Parameters
polygonGeoPolygon3pointGeoPoint3
Returns
Locate(GeoPolygon3, GeoPoint3, Tolerance)
Locates a point relative to a polygon, within a tolerance.
public static PointLocation Locate(GeoPolygon3 polygon, GeoPoint3 point, Tolerance tolerance)
Parameters
polygonGeoPolygon3The polygon.
pointGeoPoint3The point to locate.
toleranceToleranceThe tolerance.
Returns
- PointLocation
Inside when the point lies on the polygon away from its edges, OnSide when it lies on an edge, and OutSide otherwise.
Remarks
A polygon is a planar region, so a point counts as inside only when it lies on the carrier plane as well as within the boundary: a point hovering above the middle of a polygon is outside it. Within the plane the test is the even-odd rule, counting how many edges a ray from the point crosses, which is why a self-crossing polygon reports its doubly-enclosed lobes as outside.
Locate(GeoObb3, GeoPoint3)
Locates a point relative to an oriented box, using the default tolerance.
public static PointLocation Locate(GeoObb3 box, GeoPoint3 point)
Parameters
Returns
Locate(GeoObb3, GeoPoint3, Tolerance)
Locates a point relative to an oriented box, within a tolerance.
public static PointLocation Locate(GeoObb3 box, GeoPoint3 point, Tolerance tolerance)
Parameters
Returns
Remarks
The point is taken into the local frame of the box first, which turns the oriented problem into three independent comparisons against the extents. A point that is not a number is outside, as it is outside the box's body; it was inside.
Locate(GeoSolid3, GeoPoint3)
Locates a point relative to a solid, using the default tolerance.
public static PointLocation Locate(GeoSolid3 solid, GeoPoint3 point)
Parameters
Returns
Locate(GeoSolid3, GeoPoint3, Tolerance)
Locates a point relative to a solid, within a tolerance.
public static PointLocation Locate(GeoSolid3 solid, GeoPoint3 point, Tolerance tolerance)
Parameters
solidGeoSolid3The solid; its boundary is assumed closed.
pointGeoPoint3The point to locate.
toleranceToleranceThe tolerance.
Returns
- PointLocation
OnSide when the point lies where the material ends — on a face of the solid outside every opening, or on the wall of an opening where that wall runs through the body — Inside when it lies in the material, and OutSide otherwise, openings included.
Remarks
Interior points are found by counting how many faces a ray from the point crosses: an odd count means it started inside. The answer is only as good as the boundary — an open shell has no inside and the count means nothing — which is what IsClosed() is for.
An opening is asked first, because it takes away everything strictly inside it, the body's own skin included. A plate's top face is a whole square even where a bolt hole passes through it, so a point in the middle of the hole at the level of that face is on a face and in empty space at once, and empty space is the answer. The wall of an opening drawn overshooting a face, as a through-hole usually is, is boundary only where it runs through the body.
However small the tolerance, a face holds a crossing to the rounding of the body's coordinates, 1E-15 of the largest, on its plane and past its rim, and below that rounding a crossing within twice it of a rim sends the ray off in another direction; whether a face lies ahead of the point or behind it is read by the tolerance given. At a tolerance of nought a point on the axis of a cylinder is inside it, though the first ray cast runs through the seam of two of its sides, and so are the 1 000 points tried inside a cylinder 40 across and 50 tall and a cone, their axes leaning in space, where the rounding refused the crossing of nearly every face and read most of them outside. The planes of fan triangles far out can be rounded by more, and a point on the axis of a cylinder of 1 080 sides 1E7 out may still be read outside.
A body far out, reaching more than 2^20 and more than 1 024 times the size of its box from the origin, is asked near the origin, in the frame its booleans are worked out in, the point moved in with it coordinate by coordinate; so are its distance, its signed distance, its nearest point and its shortest line to a point, and where a ray, a segment or a line meets it, collides with it or stands from it, what has a place moved back out. Where it stood, its openings were cut and its faces read within a trillionth of the coordinates: of 636 points half a thousandth in and out from a plate 200 by 100 by 3 a thousand million out, with two openings up from its floor whose ceilings stood 0.0009 apart, 12 had another nearest point than at the origin. Below a trillionth of the coordinates a 256th of the reach out the body is asked where it stands, as before.
Locate(GeoCircle3, GeoPoint3)
Locates a point relative to a circular disc, using the default tolerance.
public static PointLocation Locate(GeoCircle3 circle, GeoPoint3 point)
Parameters
circleGeoCircle3pointGeoPoint3
Returns
Locate(GeoCircle3, GeoPoint3, Tolerance)
Locates a point relative to a circular disc, within a tolerance.
public static PointLocation Locate(GeoCircle3 circle, GeoPoint3 point, Tolerance tolerance)
Parameters
circleGeoCircle3pointGeoPoint3toleranceTolerance
Returns
Remarks
A disc is a planar region like a polygon, so a point counts as inside only when it lies on the carrying plane as well as within the radius: a point hovering above the centre is outside it.
Locate(GeoFace3, GeoPoint3)
Locates a point relative to a face, using the default tolerance.
public static PointLocation Locate(GeoFace3 face, GeoPoint3 point)
Parameters
Returns
Locate(GeoFace3, GeoPoint3, Tolerance)
Locates a point relative to a face, within a tolerance.
public static PointLocation Locate(GeoFace3 face, GeoPoint3 point, Tolerance tolerance)
Parameters
Returns
Remarks
A point inside a hole is outside the face, and a point on the rim of a hole is on the face boundary, since the rim is as much an edge of the material as the outer loop is.
The holes are read in the plane of the boundary, as the face is: a hole may stand off that plane by up to the planar tolerance, as one a modeller cut can, and read in its own plane it held nothing of a point on the face's a thousandth below, so that a point in the hole was inside the material.