Commit 71561489 authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

packages info and plotting in 2d working

parent d9f07ec0
......@@ -4,3 +4,9 @@ Follow on from orienting parts work.
This repo slices an stl and creates an infill based on a FEA analysis.
In progress
#### Requirements
- `sudo apt install libspatialindex-dev`
- `pip3 install rtree`
- `pip3 install trimesh`
- `pip3 install shapely`
......@@ -6,4 +6,17 @@ from shapely.geometry import LineString
mesh = trimesh.load_mesh('models/benchy.stl')
layer = mesh.section(plane_origin = (0,0,20), plane_normal=[0,0,1])
# This shows the intersections with the plane in 3d
layer.show()
# this converts it into 2d
s2,s3 = layer.to_planar()
s2.show()
#z_levels = np.arange(*mesh.bounds[:,2], step = 2)
#layers = mesh.section_multiplane(plane_origin = mesh.bounds[0],
# plane_normal = [0,0,1],
# heights = z_levels)
#np.sum(layers).show()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment