compas_model.algorithms
¤
Functions¤
brep_brep_contacts
¤
brep_brep_contacts(
a: Brep,
b: Brep,
tolerance: float = 1e-06,
minimum_area: float = 0.1,
deflection: float | None = None,
contacttype: type[Contact] = Contact,
) -> list[Contact]
Compute all face-face contact interfaces between two breps.
Parameters:
-
a(Brep) –The source brep.
-
b(Brep) –The target brep.
-
tolerance(float, default:1e-06) –Maximum deviation from the perfectly flat interface plane.
-
minimum_area(float, default:0.1) –Minimum area of a "face-face" interface.
-
deflection(float | None, default:None) –Linear deflection used to compute face overlaps.
-
contacttype(type[Contact], default:Contact) –The contact class to use for the generated interfaces.
Returns:
-
list[Contact]–The detected contact interfaces.
Notes
For equilibrium calculations (e.g. with CRA), it is important that interface frames are aligned with the direction of the (interaction) edges on which they are stored.
This means that if the bestfit frame does not align with the normal of the base source frame, it will be inverted, such that it corresponds to whatever edge is created from this source to a target.
mesh_mesh_contacts
¤
mesh_mesh_contacts(
a: Mesh,
b: Mesh,
tolerance: float = 1e-06,
minimum_area: float = 0.1,
contacttype: type[Contact] = Contact,
) -> list[Contact]
Compute all face-face contact interfaces between two meshes.
Parameters:
-
a(Mesh) –The source mesh.
-
b(Mesh) –The target mesh.
-
tolerance(float, default:1e-06) –Maximum deviation from the perfectly flat interface plane.
-
minimum_area(float, default:0.1) –Minimum area of a "face-face" interface.
-
contacttype(type[Contact], default:Contact) –The contact class to use for the generated interfaces.
Returns:
-
list[Contact]–The detected contact interfaces.
Notes
For equilibrium calculations (e.g. with CRA), it is important that interface frames are aligned with the direction of the (interaction) edges on which they are stored.
This means that if the bestfit frame does not align with the normal of the base source frame, it will be inverted, such that it corresponds to whatever edge is created from this source to a target.