ifcopenshell.api.geometry.clip_solid

Module Contents

ifcopenshell.api.geometry.clip_solid.clip_solid(file: ifcopenshell.file, item: ifcopenshell.entity_instance, location: Sequence[float], normal: Sequence[float], element: ifcopenshell.entity_instance | None = None) ifcopenshell.entity_instance

Clip a solid with a half-space plane, returning an IfcBooleanClippingResult.

Convenience wrapper around ifcopenshell.util.data.Clipping for use with any solid. This is the same convention used by the clippings parameter of add_wall_representation().

Warning

The normal points toward the removed material (the discarded side), not toward the kept material. For a slope clip the normal points upward into the removed wedge above the slope line. For a side mitre the normal points outward away from the wall body.

After clipping, set the parent IfcShapeRepresentation RepresentationType to "Clipping".

Example — trim an extruded solid to a lean-to slope (removed material is above the slope):

bcr = ifcopenshell.api.run(
    "geometry.clip_solid", model,
    item=extrusion,
    location=[0.0, 0.0, 3.26],
    normal=[0.419, 0.0, 0.908],  # points UP toward removed material
)
Parameters:
  • item – The solid to clip (IfcSweptAreaSolid, IfcSweptDiskSolid, or IfcBooleanClippingResult).

  • location – A point on the clipping plane in the representation’s local coordinate system.

  • normal – Plane normal pointing toward the material to be removed (see warning above).

  • element – If provided, the resulting IfcBooleanClippingResult is registered in the element’s BBIM_Boolean property set so that regenerate_wall_representation() preserves it during regeneration.

Returns:

The resulting IfcBooleanClippingResult.