pub fn cut_inner_edge<T: CoordsFloat>(
t: &mut Transaction,
map: &CMap2<T>,
e: EdgeIdType,
[nd1, nd2, nd3, nd4, nd5, nd6]: [DartIdType; 6],
) -> TransactionClosureResult<(), SewError>
Expand description
Cut an edge in half and build triangles from the new vertex.
This function takes an edge of the map’s as argument, cut it in half, and build four triangles from the new vertex.
+ +
/ \ /|\
/ \ / | \
/ \ / | \
/ \ / | \
/ \ / | \
+-----------+ --> +-----+-----+
\ 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 cut.[nd1, nd2, nd3, nd4, nd5, nd6]: [DartIdType; 6]
– Free darts used to create the new edges.
§Errors
This function will abort and raise an error if:
- the transaction cannot be completed,
- one of the edge’s vertex has no associated coordinates value,
- 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
.