Skip to content

Commit 7eceb6b

Browse files
committed
🏃🏻‍♂️‍➡️ Add STLInfo struct and loadmesh function for STL file handling
1 parent d7aea25 commit 7eceb6b

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/STLInfo.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#==========================================================================================++
2+
| TABLE OF CONTENTS: |
3+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4+
| struct list: |
5+
| - QueryPolygon |
6+
+------------------------------------------------------------------------------------------+
7+
| function list: |
8+
| - get_polygon (from LibGEOS, need to improve) |
9+
| - pip_query |
10+
+==========================================================================================#
11+
12+
struct STLInfo
13+
mesh::Py
14+
vmin::Vector
15+
vmax::Vector
16+
end
17+
18+
function loadmesh(stl_file)
19+
isfile(stl_file) || error("stl_file should be a valid file path")
20+
mesh = trimesh.load(stl_file, force="mesh")
21+
aabb_min, aabb_max = mesh.bounds
22+
vmin = pyconvert(Vector, aabb_min)
23+
vmax = pyconvert(Vector, aabb_max)
24+
return STLInfo(mesh, vmin, vmax)
25+
end

0 commit comments

Comments
 (0)