curvature
Queries · api.md § curvature · all operations
definition
curvature(s: Solid, points: list<Point3>) -> list<Number[2] or null>
Gives the principal curvatures [k1, k2] of the boundary, with k1 ≥ k2, in 1/mm. For each given point, the curvatures are taken at the point of the boundary nearest to it, so the given point need not lie on the boundary. A curvature is positive where the boundary bends away from its outward normal, as on a ball, and negative where the boundary bends toward its outward normal, as round a hole. Where the nearest point lies on a crease, the answer is null.
A plane has [0, 0]. A cylinder of radius r has [1/r, 0], a ball has [1/R, 1/R], and a hole has [0, −1/r]. A cone has [cos α/ρ, 0] at radius ρ, where its side leans α from its axis. A ring of radii R and r has 1/r and cos φ/(R + r cos φ) at angle φ round its tube.
Example. Solid 1 is a cylinder of radius 5 on the z axis.
> {"cmd": "curvature", "s": 1, "points": [[5, 0, 10]]}
< {"ok": [[0.2, 0.0]]}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>> |