Skip to content

Commit b477ec1

Browse files
committed
better brep contacts
1 parent 7b52c65 commit b477ec1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
* Added `Model.has_element_with_name`.
1313
* Added `Model.find_element_with_name`.
14+
* Added `Model.find_element_with_name_or_fail`.
15+
* Added `Model.find_all_elements_of_type`.
16+
* Added `Model.remove_elements_of_type`.
17+
* Added `Model.add_or_get_material`.
1418

1519
### Changed
1620

src/compas_model/algorithms/contacts.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,18 @@ def brep_brep_contacts(
128128

129129
if a_faces and b_faces:
130130
for a_face in a_faces:
131-
a_poly: Polygon = a_face.to_polygon()
132-
133131
if a_face.area < minimum_area:
134132
continue
135133

134+
a_poly: Polygon = a_face.to_polygon()
136135
a_points = a_poly.points
137136
a_normal = a_poly.normal.unitized()
138137

139138
for b_face in b_faces:
140-
b_poly: Polygon = b_face.to_polygon()
141-
142139
if b_face.area < minimum_area:
143140
continue
144141

142+
b_poly: Polygon = b_face.to_polygon()
145143
b_points = b_poly.points
146144
b_normal = b_poly.normal.unitized()
147145

@@ -152,6 +150,11 @@ def brep_brep_contacts(
152150
# the interface is incorrect
153151

154152
if result:
153+
# if a_face.area < b_face.area:
154+
# c = OCCBrep.from_brepfaces([a_face])
155+
# else:
156+
# c = OCCBrep.from_brepfaces([b_face])
157+
155158
points, frame, area = result
156159
contact = contacttype(points=points, frame=frame, size=area)
157160
contacts.append(contact)

0 commit comments

Comments
 (0)