Feature-Driven Pipeline#

While the Defeaturer gives you manual, step-by-step control, the feature-driven pipeline defeatures a part in one call: it recognises the part’s features, decides which to remove, removes them in dependency order, and reports what it did.

Note

Prerequisites: Defeaturing Concepts and Defeaturer.

When to use it#

Reach for the pipeline when you want the whole part simplified to its base shape (its stock) without choosing features by hand — for example, before recognising the manufacturing operations that produced the part. Use the Defeaturer directly when you want to remove specific features yourself.

Running the pipeline#

from volmdlr.shapes import Solid
from volmdlr_tools.shape_editing import BRepDefeaturerProcessor

shape = Solid.from_brep("ANC101.brep")
result = BRepDefeaturerProcessor(shape).run()

print(result.defeatured_shape)           # the simplified solid
print(result.stock_type)                 # "extrusion", "revolved", or None

The pipeline runs in two stages:

  1. Identify — every feature is recognised on the original part without changing it, and each is tagged with a remove-or-keep decision. Additive material (bosses, stock) is kept; subtractive detail (holes, pockets, blends, chamfers) is marked for removal.

  2. Defeature — the features marked for removal are removed innermost-first, so a detail nested inside another is removed before its parent. Bosses are then split off and the remaining base shape is recognised as stock.

Reading the result#

DefeaturingResult collects everything the pipeline produced. The most useful fields:

  • defeatured_shape — the simplified solid, the pipeline’s headline output.

  • defeatured_aag and face_map — the simplified part’s face graph and a mapping from each surviving face back to the original face it came from.

  • holes — the holes that were recognised and removed.

  • boss_extrusions and stock_shape — the additive bosses split off and the base stock the part was built on.

  • registry — face-claim coverage (see below).

Face-claim coverage#

As the pipeline recognises and removes features, it records which original faces each one accounts for in a FaceNodeRegistry. Every face is awarded to the first feature that claims it, so overlapping recognitions never double-count. result.registry.claimed_ratio() reports the fraction of the part’s faces accounted for, and is_fully_claimed() tells you whether every face was explained — a quick health check that the part was fully understood.

See Also#