Marching Squares on Surface¶
Dependencies¶
This node requires SkImage library to work.
Functionality¶
This node uses Marching Squares algorithm to find iso-lines of a scalar field on an arbitrary surface, i.e. lines for which the value of scalar field equals to the given value at each point. The lines are generated as mesh - vertices and edges. You can use one of interpoolation nodes to build Curve objects from them.
Inputs¶
This node has the following inputs:
Field. Scalar field to generate iso-lines for. This input is mandatory.
Surface. The surface to draw iso-lines on. This input is mandatory.
Value. The value of scalar field, for which to generate iso-lines. The default value is 1.0.
SamplesU, SamplesV. Number of samples along U and V parameter of the surface, correspondingly. This defines the resolution of curves: the bigger isvalue, the more vertices will the node generate, and the more precise the curves will be. But higher resolutioln requires more computation time. The default value is 50 for both inputs.
Parameters¶
This node has the following parameters:
Join by surface. If checked, then mesh objects generated for each separate contour on one surface will be merged into one mesh object. Otherwise, separate mesh object will be generated for each contour. Checked by default.
Connect boundary. If checked, the node will connect pieces of the same curve, that was split because it was cut by the boundary of the surface. Otherwise, several separate pieces will be generated in such case. Note that this node can not currently detect if the surface is closed to glue parts of contours at different sides of the surface. Checked by default.
Outputs¶
This node has the following outputs:
Vertices. Generated iso-curves vertices in 3D space.
Edges. Edges connecting iso-curve vertices.
UVVertices. Points in surface’s U/V space, corresponding to generated iso-curve vertices.
Examples of usage¶
Generator-> NGon
Surfaces-> Plane (Surface)
Surfaces-> Evaluate Surface
Fields-> Attractor Field
Transform-> Noise Displace
Number-> Number Range
MUL: Number-> Scalar Math
Vector-> Vector In
Matrix-> Matrix In
List->List Main-> List Length
Color-> Color Ramp
Scene-> Frame Info
Viz-> Viewer Draw
Find iso-curves of attractor field on a cylindrical surface:
https://gist.github.com/10ddbe4d04655dc8a1553c9b7fb68ee8
Generator-> Box
Curves-> Circle (Curve)
Surfaces-> Extrude Curve Along Vector
Surfaces-> Evaluate Surface
Fields-> Attractor Field
Modifiers->Modifier Change-> Merge by Distance
Transform-> Noise Displace
Number-> Number Range
Matrix-> Matrix In
Matrix Multiply: Matrix-> Matrix Math
List->List Main-> List Length
Color-> Color Ramp
Viz-> Viewer Draw
Another example with multiple surfaces (old image):
Restore with new nodes:
https://gist.github.com/f177b018f8871cad33dab532cbcd9ac3
Generator-> Segment
Curves-> Circle (Curve)
Curves-> Surface Boundary
Curves-> Evaluate Curve
Curves-> Cubic Spline
Surfaces-> Extrude Curve Along Vector
Surfaces-> Tesselate & Trim Surface
Fields-> Attractor Field
Matrix-> Matrix In
Viz-> Viewer Draw