Skip to main content

same_build

Function same_build 

Source
pub fn same_build(a: &Value, b: &Value) -> bool
Expand description

Whether two part documents build the same solids and ports, so that one’s snapshot serves the other.

A snapshot is what run_isolated_document makes of a document: the document read as a HistoryRequest with its editor stop points cleared. Everything that request does not read — the eCAD symbol and pads blocks, the BOM partAttributes, drawing sheets — cannot change what the part builds, so two documents that read as the same request build the same part. The comparison is of that request, not of a list of keys that do or do not matter, so a block the request learns to read later counts at once.

Sketch loop ids are stamped on both sides first, as every library door stamps them. A document that does not read as a request is never the same build as anything: it has to heal.