Skip to content

Commit b1d8447

Browse files
committed
Error on non-triangular face
1 parent bf937bf commit b1d8447

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/kite_geometry.jl

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,21 +203,7 @@ function center_to_com!(vertices, faces)
203203
area_total += area
204204
com += area * centroid
205205
else
206-
println("found non-triangular face")
207-
# Non-triangular face case - triangulate the face
208-
v1 = vertices[face[1]] # Use first vertex as pivot
209-
for i in 2:length(face)-1
210-
v2 = vertices[face[i]]
211-
v3 = vertices[face[i+1]]
212-
213-
# Calculate triangle area and centroid for this triangle
214-
normal = cross(v2 - v1, v3 - v1)
215-
area = norm(normal) / 2
216-
centroid = (v1 + v2 + v3) / 3
217-
218-
area_total += area
219-
com += area * centroid
220-
end
206+
throw(ArgumentError("Triangulate faces in a CAD program first"))
221207
end
222208
end
223209

0 commit comments

Comments
 (0)