NURBS Surface Trims
Trimmed NURBS surfaces are followed by a terminated list of surface trims. Much like the top-level opcodes, surface trims have a format that is dictatedby the opcode character. The main differences are that they always apply to NURBS surfaces,and there are few enough of them to be described in just this one document.
Trim objects generally specify a closed region on the parameter space of the NURBS surface. The only exception to this is are trim objects that are given as part of a trim collection,in which case they describe one section of a piecewise closed region. In addition do describingthe closed region, they dictate the operation that is to be done on that area, either “keep” or”remove”. “Remove” operations cut away the closed region. “Keep” operations cut away everything exceptthe region. The operation control bit (0x01) on objects that are part of an NS_Trim_Collection
is ignored, since only collectively do such objects specify a closed region.
NURBS surfaces are parameterized from 0 to 1 always, so control vertices should be specifiedwith that in mind. Note that this contrasts with some solid modelling kernels, which parameterize their surfaces with respect to their knots.
Trim opcodes:0 | trim list termination |
1 | trim poly |
2 | trim curve |
3 | trim collection |
0x01 | trim is a "keep" operation |
0x02 | trim curve has weights (relevant to trim curve only) |
0x04 | trim curve has knots (relevant to trim curve only) |
NS_Trim_Termination (0)
No operands.
NS_Trim_Poly (1)
Byte control_bits, Long control_count, (2 x control_count) x Float control_points,control_bits | miscellaneous control options bits (see above) |
point_count | number of control points in the poly |
points | control_count pairs of u,v data |
Byte degree,
Long control_count,
(2 x control_count) x Float control_points,
[(control_count) x Float weights],
[(control_count+degree+1) x Float knots],
[Float start],
[Float end]
control_bits | miscellaneous control options bits (see above) |
degree | degree of the curve |
control_count | number of control points in the curve |
control_points | control_count triplets of x, y, z data |
weights | control_count weight factors |
knots | control_count + degree + 1 knot values |
start | parametric start point (0-1, default 0) |
end | parametric end point (0-1, default 1) |
control_bits | miscellaneous control options bits (see above) |
trim list | a terminated list of trim objects that together form a single closed region. |