classify
Queries · api.md § classify · all operations
definition
classify(s: Solid, points: list<Point3>) -> list<"in" or "on" or "out">
Asks where each of many points lies against the solid.
Returns one answer for each point, in order. The answer is "in" where s holds the point clear of the boundary of s, "on" where the point lies on the boundary, and "out" otherwise. The boundary is every point within ε of a face, an edge or a vertex. A point further than 10·ε from the boundary is "in" or "out". A point off the boundary but within 10·ε of it may be given as either or as "on". A kernel that cannot place one of the points refuses the whole call. It does not answer for the other points alone.
Example. Solid 1 is a 10 × 20 × 30 mm box with one corner at the origin. The second point lies on its top face.
> {"cmd": "classify", "s": 1, "points": [[5, 10, 15], [5, 10, 30], [20, 0, 0]]}
< {"ok": ["in", "on", "out"]}common to queries
| Function | Fields | Returns |
|---|---|---|
volume | s | Volume |
area | s | Area |
classify | s, points | list<"in" or "on" or "out"> |
closest | s, points | list<Point3> |
normal | s, points | list<Vector3 or null> |
curvature | s, points | list<Number[2] or null> |
check | s | list<string> |
centroid | s | Point3 or null |
inertia | s | Number[3][3] |
distance | a, b | Length |
interference | a, b | {volume: Volume, gap: Length} |
betti | s | Count[3] |
section_area | s, origin, normal | Area |
section | s, origin, normal, tolerance | list<list<Point3>> |
project | s, direction, tolerance | {visible: list<list<Point2>>, hidden: list<list<Point2>>} |
bounding_box | s | Point3[2] |
split | s, origin, normal | Solid[2] |
mesh | s, tolerance | {positions: list<Point3>, triangles: list<Index[3]>} |
display | s, tolerance | {faces: list<Face>, edges: list<list<Point3>>} |
raycast | s, origin, direction; or s, rays | list<Length>; or list<list<Length>> |