Closed hurryhuang1007 closed 5 years ago
@hurryhuang1007 thanks for the information.
Can you supply a quick code snippet? There are several ways to get the cross section. I want to know the functions being used.
@z3dev The code in the demo that I posted was my implementation in my project
@z3dev the “edit on code sandbox” is a link
@z3dev Excuse me, can u tell me is it I used the wrong API or it was a bug?
The tetrahedron seems to be created with opposing faces, so I reversed the face definitions to create a valid solid.
let faces = [[0, 1, 2], [0, 3, 1], [0, 2, 3], [1, 3, 2]];
Now, the section cut seems to work, but has some rotation issues due to the basis. Please review.
yeah, thx for ur answer, it's work.
But I don't understand the difference define faces by [[0, 1, 2], [0, 3, 1], [0, 2, 3], [1, 3, 2]]
or [[0, 1, 3], [0, 2, 1], [0, 3, 2], [1, 2, 3]]
.
Should there be a difference?
Basically, the order of the vertices controls not just the shape, but also the 'normal' of the polygon. The normal is very important when performing union, intersection, difference. As well as, rendering the polygon.
https://en.wikipedia.org/wiki/Normal_(geometry)
If you look at the contents of each Polygon, you will find there's a list of vertices AND a plane. The plane is calculated form the order of the vertices.
Hope that helps.
@hurryhuang1007 Please close if satisfied. Thanks.
very thx, I close it now.
I created a tetrahedron and used a plane to intercept it. But there seems to be an additional bounding box in the result.
the dome:
in my project like this: