pub fn swap_edge<T: CoordsFloat>(
t: &mut Transaction,
map: &CMap2<T>,
e: EdgeIdType,
) -> TransactionClosureResult<(), EdgeSwapError>
Expand description
Tip over an edge shared by two triangles.
The edge is tipped in the clockwise direction. Vertices that were shared become exclusive to each new triangle and vice versa:
+ +
/ \ /|\
/ \ / | \
/ \ / | \
/ \ / | \
/ \ / | \
+-----------+ --> + | +
\ e / \ | /
\ / \ | /
\ / \ | /
\ / \ | /
\ / \|/
+ +
This function expects to operate on a triangular mesh. At the moment, calling it on another type of mesh may result in non-explicit errors (e.g. an internal sew operation will consistently fail due to a dart being non-free) as there is no check on each faces’ degree.
§Arguments
t: &mut Transaction
– Associated transaction.map: &mut CMap2
– Edited map.e: EdgeIdType
– Edge to move.
§Panics
This function will panic if there is no cell on one side of the edge.
§Errors
This function will abort and raise an error if:
- the transaction cannot be completed,
- one internal sew operation fails.
The returned error can be used in conjunction with transaction control to avoid any
modifications in case of failure at attribute level. The user can then choose to retry or
abort as he wishes using Transaction::with_control_and_err
.