| title | flip / reverse | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Reverse reference orientation without changing finite geometry or parameter points. | |||||||||||||||||||||||
| sourceReview |
|
|||||||||||||||||||||||
| sidebar |
|
|||||||||||||||||||||||
| head |
|
Reverse reference orientation without changing finite geometry or parameter points.
import {line, rectangle} from '@code3d/core';
export const segment = line([0, 0, 0], [10, 0, 0]);
export const backward = segment.reverse();
export const sheet = rectangle(12, 8);
export const downward = sheet.flip();Complete example: topology and references.
lineAnchor.reverse(): typeof lineAnchor;
faceAnchor.flip(): typeof faceAnchor;
bound.flip(): Bound;
edgeModel.reverse(): Edge;
faceModel.flip(): Surface;Import the functions and named types from @code3d/core.
LineAnchor.reverse() returns a reference with opposite direction sense.
An Edge retains its ID, finite curve, length and reference axes. Its
start, midpoint and end still select the same underlying parameter positions;
reverse does not swap those properties or reverse the stored curve geometry.
Use it when align should match opposite curve directions, or when a straight axisLine should use the opposite positive rotation sense. Point membership on a curve ignores direction, so it is unchanged. The original reference remains unchanged too.
FaceAnchor.flip() returns a reference with reversed normal sense. A selected
Surface keeps its ID, finite region, area, position and reference axes. It does
not modify the BRep face or produce a new solid. Plane coincidence can use the
opposite normal, while point-on-surface membership is unchanged.
A Bound also supports flip: its boundary stays in place and only its directed
contact sense reverses. up.flip() stays on the upper boundary; it does not
select the lower one.
EdgeModel.reverse() selects its edge and returns an Edge reference.
FaceModel.flip() selects its surface and returns a Surface reference.
These shortcuts do not return new edge or face models. In the example,
backward.length remains 10 and downward.area remains 96. The results are useful
in constraints and queries, but cannot be passed as standalone geometry children
or as model inputs to extrude, sweep or thicken.
For changing local geometry, use modeling transforms on the original model. For choosing coordinate zero use the origin methods. Reversing a reference twice restores its orientation sense; reference object identity is not an equality test for geometry or topology.