mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-05 11:35:55 +00:00
record: a body built from a sketch has new edges, with no origins
of_faces gave every edge it was not told about the meeting of its two faces. A builder (extrude, revolve, loft, a primitive) has no operands: every face it makes is new, so its edges are new too (EdgeProv: empty when it is new and lies between faces new to the operation), not where profile segments meet. With no operands an edge's origins are only what the builder states. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BnQawySUFx57iaJZq7z1Fm
This commit is contained in:
@@ -52,7 +52,8 @@ pub(crate) fn pieces_of(operand: usize, edges: impl IntoIterator<Item = usize>)
|
||||
/// `faces` (an operand face shared by several result faces is marked Split), and whose edges come
|
||||
/// from `edges` (by result edge index) where the building code knows them: an operand edge it
|
||||
/// kept or re-made ([`pieces_of`]). Every other edge separates two faces that met nowhere before,
|
||||
/// so it comes from their meeting ([`meeting`]).
|
||||
/// so it comes from their meeting ([`meeting`]); an operation with no operands (a body built
|
||||
/// from a sketch) makes every face and edge new, so its edges have no origins.
|
||||
pub(crate) fn of_faces(result: &Brep, operands: usize, mut faces: Vec<FaceProv>, edges: &[Vec<EdgeOrigin>]) -> History {
|
||||
mark_shared_split(&mut faces);
|
||||
let edges = edge_faces(result)
|
||||
@@ -61,6 +62,7 @@ pub(crate) fn of_faces(result: &Brep, operands: usize, mut faces: Vec<FaceProv>,
|
||||
.map(|(i, between)| {
|
||||
let origins = match edges.get(i) {
|
||||
Some(known) if !known.is_empty() => known.clone(),
|
||||
_ if operands == 0 => Vec::new(),
|
||||
_ => meeting(&between, &faces),
|
||||
};
|
||||
EdgeProv { faces: between, origins }
|
||||
|
||||
Reference in New Issue
Block a user