add innerWallPlane

This commit is contained in:
Octopus Octopus 2022-07-03 15:17:20 -05:00
parent a3ad3ee761
commit 760ccbda5a
2 changed files with 13 additions and 4 deletions

View File

@ -70,6 +70,14 @@ func bottomPlane() sdf.SDF2 {
return bottom
}
func innerWallPlane() sdf.SDF2 {
wall := sdf.Box2D(v2.Vec{X: 6, Y: BODY_SIZE_Y}, 0)
wall = sdf.Difference2D(wall, screwHoles())
return wall
}
// screwHoles produces m4 screwHoles along the sides of the piece.
func screwHoles() sdf.SDF2 {
hole, _ := sdf.Circle2D(M4_SCREW_DIAMETER / 2)

View File

@ -15,10 +15,11 @@ func main() {
render.RenderDXF(topPlane(), 600, "top.dxf")
render.RenderDXF(wallsPlane(), 600, "walls.dxf")
render.RenderDXF(wallCorner(), 600, "wallcorner.dxf")
render.ToSTL(wallFrontLeft(), 100, "wallfrontleft.stl", dc.NewDualContouringDefault())
render.ToSTL(wallFrontRight(), 100, "wallfrontright.stl", dc.NewDualContouringDefault())
render.ToSTL(wallBackLeft(), 100, "wallbackleft.stl", dc.NewDualContouringDefault())
render.ToSTL(wallBackRight(), 100, "wallbackright.stl", dc.NewDualContouringDefault())
render.RenderDXF(innerWallPlane(), 600, "innerwall.dxf")
render.ToSTL(wallFrontLeft(), 400, "wallfrontleft.stl", dc.NewDualContouringDefault())
render.ToSTL(wallFrontRight(), 400, "wallfrontright.stl", dc.NewDualContouringDefault())
render.ToSTL(wallBackLeft(), 400, "wallbackleft.stl", dc.NewDualContouringDefault())
render.ToSTL(wallBackRight(), 400, "wallbackright.stl", dc.NewDualContouringDefault())
for i, ele := range tops {
render.ToSTL(sdf.Extrude3D(ele, 3), 400, "top-"+strconv.Itoa(i)+".stl", dc.NewDualContouringDefault())
}