Obtain 3D shape cross section
조회 수: 10 (최근 30일)
이전 댓글 표시
i have designed a part in CAD based software as shown in the image, this shape is extruded on the Z axis. I am looking for a way to import this geometry into MATLAB and select a specific Z offset from which i can obtain the points that make up the cross section at the Z offset. Additionally I would like to seperate the points into an outer and inner groups and order the points in a way that if plotted they connect to draw the accurate cross section with no intersections.
I have tried importing the shape as an stl file and then i obtain the points at the desired Z offset by getting the intersetcions of the triangles generated from the mesh at the Z offset, however the points obtained are not in order and adapting the nearest point algorithm isnt sufficient to correct the order for any random geometry.
댓글 수: 1
Daniel Bengtson
2023년 8월 8일
If this example is representative of the shapes that you are working with, could you convert the points that you have into polar coordinates then just sort by theta? Thresholding between the outer and inner boundary could probably be done by clustering rho.
답변 (1개)
Shubham
2023년 9월 6일
Building on the idea suggested by @Daniel Bengtson in the comments, You can separate the inner and outer points by various ways:
- Clustering the points
- Using any known feature or shape that your CAD model provides to get the threshold value to categorize between inner and outer points.
- You can visually inspect the cross-section and adjust the threshold until it separates the points correctly.
- Calculate the distance between each point and the centroid of the cross-section. Set the threshold based on the mean distance from the centroid of cross section (average of points) to all other intersection points.
After separating the points into inner points and outer points, You can order them based on their angle. Take one point and centroid as a reference and calculate angles of other points and sort them.
Hope this helps!!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!