Function Reference: solid.surface

drafting: S = solid.surface (X, Y, Z, H)

A solid made of a smooth surface through a grid of points.

S = solid.surface (X, Y, Z, H) fits an exact B-spline surface through the grid of points X, Y and Z, passing within 0.001 mm of every point, and returns the solid.Shape that surface makes thickened square to itself. X, Y and Z are real matrices of one size, at least 2 by 2, holding the coordinates of the points in rows and columns, as meshgrid makes them. The grid stays the input and what comes out is smooth, where solid.polyhedron on the same grid gives facets.

The normal of the surface is the step from one column of the grid to the next crossed with the step from one row to the next. For a grid made by meshgrid, whose columns step along x and rows along y, it points up, along +z. Transposing X, Y and Z turns it round.

H is the thickness in millimetres and which way it goes, as solid.extrude takes it:

a positive scalar
along the normal, the surface the face of the solid against it;
a negative scalar
against the normal, the same thickness the other way;
[H1, H2], both positive
to both sides of the surface, H1 along the normal and H2 against it, so [0.5, 0.5] is a thickness of 1 centred on it.

The grid must be open: neighbouring points must not coincide, and neither its first and last rows nor its first and last columns may meet, closing the surface on itself.

A surface thickened by more than the radius it curves with folds over itself. That is refused, naming the side of the surface and its tightest radius there. A point the grid comes to, such as the tip of sind (hypot (X, Y)) at the origin, is rounded off by the fit at a radius set by the spacing of the grid, and limits the thickness the same way. The edges of the solid run square to the surface.

 
 ## A ripple 20 across, made a skin 1 thick centred on it
 [x, y] = meshgrid (-10:0.5:10);
 S = solid.surface (x, y, cosd (72 * hypot (x, y)), [0.5, 0.5]);

See also: solid.polyhedron, solid.extrude, solid.Shape

Source Code: solid.surface