start (and abandon) countersunk screws
This commit is contained in:
parent
b5ebf4c284
commit
bddcf98424
|
@ -7,12 +7,28 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
TOP_HEIGHT = 3.0
|
TOP_HEIGHT = 4.0
|
||||||
WALLS_HEIGHT = 45.0
|
WALLS_HEIGHT = 45.0
|
||||||
BOTTOM_HEIGHT = 3.0
|
BOTTOM_HEIGHT = 3.0
|
||||||
WALL_NOTCH = 5.0
|
WALL_NOTCH = 5.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func top() sdf.SDF3 {
|
||||||
|
top := sdf.Extrude3D(topPlane(), TOP_HEIGHT)
|
||||||
|
// screws := sdf.Transform3D(screwCountersinks(), sdf.Translate3d(v3.Vec{X: 0, Y: 0, Z: TOP_HEIGHT/2 - screwCountersinks().BoundingBox().Max.Z}))
|
||||||
|
// top = sdf.Difference3D(top, screws)
|
||||||
|
return top
|
||||||
|
}
|
||||||
|
|
||||||
|
func topLeft() sdf.SDF3 {
|
||||||
|
return split3DModel(top())[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
func topRight() sdf.SDF3 {
|
||||||
|
return split3DModel(top())[1]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// wallFrontRight is the front right wall. This houses the neutrik connector.
|
// wallFrontRight is the front right wall. This houses the neutrik connector.
|
||||||
func wallFrontRight() sdf.SDF3 {
|
func wallFrontRight() sdf.SDF3 {
|
||||||
corner := wallCorner()
|
corner := wallCorner()
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/deadsy/sdfx/sdf"
|
"github.com/deadsy/sdfx/sdf"
|
||||||
v2 "github.com/deadsy/sdfx/vec/v2"
|
v2 "github.com/deadsy/sdfx/vec/v2"
|
||||||
|
v3 "github.com/deadsy/sdfx/vec/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -114,3 +115,31 @@ func screwHoles() sdf.SDF2 {
|
||||||
|
|
||||||
return sdf.Union2D(holes...)
|
return sdf.Union2D(holes...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// screwHoles produces m4 screwHoles along the sides of the piece.
|
||||||
|
func screwCountersinks() sdf.SDF3 {
|
||||||
|
cone, _ := sdf.Cone3D(2.3, M4_SCREW_DIAMETER/2, 7.2/2, 0)
|
||||||
|
coneCenter, _ := sdf.Cone3D(2.3, M3_SCREW_DIAMETER/2, 5.6/2, 0)
|
||||||
|
cones := make([]sdf.SDF3, 14) // 1 top + 1 bottom + (1 * 2 corners) + 2 right, + 1 center = 7 for one side, 14 for two sides.
|
||||||
|
for i := range cones {
|
||||||
|
cones[i] = cone
|
||||||
|
}
|
||||||
|
centerOffset := 3.0
|
||||||
|
sideOffset := 4.0
|
||||||
|
buffer := 2.5
|
||||||
|
// right side
|
||||||
|
cones[0] = coneCenter
|
||||||
|
cones[0] = sdf.Transform3D(cones[0], sdf.Translate3d(v3.Vec{X: centerOffset, Y: 0, Z: 0}))
|
||||||
|
cones[1] = sdf.Transform3D(cones[1], sdf.Translate3d(v3.Vec{X: centerOffset, Y: (BODY_SIZE_Y / 2) - (WALL_THICKNESS / buffer), Z: 0}))
|
||||||
|
cones[2] = sdf.Transform3D(cones[1], sdf.MirrorXZ())
|
||||||
|
cones[3] = sdf.Transform3D(cones[3], sdf.Translate3d(v3.Vec{X: (BODY_SIZE_X / 2) - (WALL_THICKNESS), Y: (BODY_SIZE_Y / 2) - (WALL_THICKNESS), Z: 0}))
|
||||||
|
cones[4] = sdf.Transform3D(cones[3], sdf.MirrorXZ())
|
||||||
|
cones[5] = sdf.Transform3D(cones[5], sdf.Translate3d(v3.Vec{X: (BODY_SIZE_X / 2) - (WALL_THICKNESS / buffer), Y: sideOffset, Z: 0}))
|
||||||
|
cones[6] = sdf.Transform3D(cones[5], sdf.MirrorXZ())
|
||||||
|
|
||||||
|
for o := 0; o < len(cones)/2; o++ {
|
||||||
|
cones[o+len(cones)/2] = sdf.Transform3D(cones[o], sdf.MirrorYZ())
|
||||||
|
}
|
||||||
|
|
||||||
|
return sdf.Union3D(cones...)
|
||||||
|
}
|
||||||
|
|
|
@ -8,11 +8,14 @@ import (
|
||||||
"github.com/deadsy/sdfx/sdf"
|
"github.com/deadsy/sdfx/sdf"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TODO: Figure out countersinks lol
|
||||||
func main() {
|
func main() {
|
||||||
tops := split2DPlane(topPlane())
|
tops := split2DPlane(topPlane())
|
||||||
bottoms := split2DPlane(bottomPlane())
|
bottoms := split2DPlane(bottomPlane())
|
||||||
render.RenderDXF(topPlane(), 600, "top.dxf")
|
render.RenderDXF(topPlane(), 600, "top.dxf")
|
||||||
render.RenderDXF(wallsPlane(), 600, "walls.dxf")
|
render.RenderDXF(wallsPlane(), 600, "walls.dxf")
|
||||||
|
/* render.ToSTL(topLeft(), 400, "topLeft.stl", dc.NewDualContouringDefault())
|
||||||
|
render.ToSTL(topLeft(), 400, "topRight.stl", dc.NewDualContouringDefault()) */
|
||||||
render.ToSTL(innerWall(), 400, "innerwall.stl", dc.NewDualContouringDefault())
|
render.ToSTL(innerWall(), 400, "innerwall.stl", dc.NewDualContouringDefault())
|
||||||
render.ToSTL(wallFrontRight(), 400, "wallfrontright.stl", dc.NewDualContouringDefault())
|
render.ToSTL(wallFrontRight(), 400, "wallfrontright.stl", dc.NewDualContouringDefault())
|
||||||
render.ToSTL(wallBackLeft(), 400, "wallbackleft.stl", dc.NewDualContouringDefault())
|
render.ToSTL(wallBackLeft(), 400, "wallbackleft.stl", dc.NewDualContouringDefault())
|
||||||
|
|
Loading…
Reference in New Issue