thin wall, add protrosions for screws, remove function row,
This commit is contained in:
parent
a87ea2761f
commit
48786d7de6
|
@ -7,10 +7,10 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
BODY_SIZE_X = 300
|
BODY_SIZE_X = 300
|
||||||
BODY_SIZE_Y = 220
|
BODY_SIZE_Y = 215
|
||||||
BODY_SIZE_Z = 2 + 0 + 0 //Top + Walls + Base
|
BODY_SIZE_Z = 2 + 0 + 0 //Top + Walls + Base
|
||||||
BODY_CURVE = 10
|
BODY_CURVE = 10
|
||||||
WALL_THICKNESS = 15
|
WALL_THICKNESS = 6.9
|
||||||
)
|
)
|
||||||
|
|
||||||
// topPlane produces a 2D top-down image of the fightstick's top panel.
|
// topPlane produces a 2D top-down image of the fightstick's top panel.
|
||||||
|
@ -26,10 +26,10 @@ func topPlane() sdf.SDF2 {
|
||||||
buttons = loggedMovement(buttons, v2.Vec{X: top.BoundingBox().Max.X / 2, Y: top.BoundingBox().Max.Y / 4}, "button cluster")
|
buttons = loggedMovement(buttons, v2.Vec{X: top.BoundingBox().Max.X / 2, Y: top.BoundingBox().Max.Y / 4}, "button cluster")
|
||||||
top = sdf.Difference2D(top, buttons)
|
top = sdf.Difference2D(top, buttons)
|
||||||
|
|
||||||
auxillaryButtons := functionRow()
|
// auxillaryButtons := functionRow()
|
||||||
// this is a bit ugly
|
// this is a bit ugly
|
||||||
auxillaryButtons = loggedMovement(auxillaryButtons, v2.Vec{X: -top.BoundingBox().Max.X / 2.4, Y: 4 * (top.BoundingBox().Max.Y / 5)}, "function cluster")
|
// auxillaryButtons = loggedMovement(auxillaryButtons, v2.Vec{X: -top.BoundingBox().Max.X / 2.4, Y: 4 * (top.BoundingBox().Max.Y / 5)}, "function cluster")
|
||||||
top = sdf.Difference2D(top, auxillaryButtons)
|
// top = sdf.Difference2D(top, auxillaryButtons)
|
||||||
|
|
||||||
return top
|
return top
|
||||||
}
|
}
|
||||||
|
@ -38,32 +38,15 @@ func topPlane() sdf.SDF2 {
|
||||||
func wallsPlane() sdf.SDF2 {
|
func wallsPlane() sdf.SDF2 {
|
||||||
walls := sdf.Box2D(v2.Vec{X: BODY_SIZE_X, Y: BODY_SIZE_Y}, BODY_CURVE)
|
walls := sdf.Box2D(v2.Vec{X: BODY_SIZE_X, Y: BODY_SIZE_Y}, BODY_CURVE)
|
||||||
body := sdf.Box2D(v2.Vec{X: BODY_SIZE_X - WALL_THICKNESS, Y: BODY_SIZE_Y - WALL_THICKNESS}, BODY_CURVE)
|
body := sdf.Box2D(v2.Vec{X: BODY_SIZE_X - WALL_THICKNESS, Y: BODY_SIZE_Y - WALL_THICKNESS}, BODY_CURVE)
|
||||||
|
|
||||||
walls = sdf.Difference2D(walls, body)
|
walls = sdf.Difference2D(walls, body)
|
||||||
|
|
||||||
// left and right side
|
screwProtrosion := sdf.Box2D(v2.Vec{X: WALL_THICKNESS / 3, Y: 12}, 0)
|
||||||
lrCutout := trapezoid(v2.Vec{X: (BODY_SIZE_Y - 20) / 2, Y: WALL_THICKNESS / 4}, -30)
|
rProt := loggedMovement(screwProtrosion, v2.Vec{X: (BODY_SIZE_X / 2) - (WALL_THICKNESS / 1.6), Y: 0}, "right screw protrosion")
|
||||||
ltCutout := sdf.Transform2D(lrCutout, sdf.Rotate2d(sdf.DtoR(270)))
|
lProt := loggedMovement(screwProtrosion, v2.Vec{X: -(BODY_SIZE_X / 2) - -(WALL_THICKNESS / 1.6), Y: 0}, "left screw protrosion")
|
||||||
ltCutout = sdf.Transform2D(ltCutout, sdf.Translate2d(v2.Vec{X: -((BODY_SIZE_X / 2) - ltCutout.BoundingBox().Max.X), Y: BODY_SIZE_Y / 4}))
|
tProt := sdf.Transform2D(screwProtrosion, sdf.Rotate2d(sdf.DtoR(90)))
|
||||||
lbCutout := sdf.Transform2D(ltCutout, sdf.MirrorX())
|
bProt := loggedMovement(tProt, v2.Vec{X: 0, Y: -(BODY_SIZE_Y / 2) - -(WALL_THICKNESS / 1.6)}, "bottom screw protrosion")
|
||||||
rtCutout := sdf.Transform2D(ltCutout, sdf.MirrorY())
|
tProt = loggedMovement(tProt, v2.Vec{X: 0, Y: (BODY_SIZE_Y / 2) - (WALL_THICKNESS / 1.6)}, "top screw protrosion")
|
||||||
rbCutout := sdf.Transform2D(lbCutout, sdf.MirrorY())
|
walls = sdf.Union2D(walls, rProt, lProt, tProt, bProt)
|
||||||
walls = sdf.Difference2D(walls, ltCutout)
|
|
||||||
walls = sdf.Difference2D(walls, lbCutout)
|
|
||||||
walls = sdf.Difference2D(walls, rtCutout)
|
|
||||||
walls = sdf.Difference2D(walls, rbCutout)
|
|
||||||
|
|
||||||
// top and bottom sides
|
|
||||||
// TODO: This is producing holes in the render :(
|
|
||||||
tbCutout := trapezoid(v2.Vec{X: (BODY_SIZE_X - 20) / 2, Y: WALL_THICKNESS / 4}, -40)
|
|
||||||
blCutout := sdf.Transform2D(tbCutout, sdf.Translate2d(v2.Vec{X: -(BODY_SIZE_X / 4), Y: -((BODY_SIZE_Y / 2) - tbCutout.BoundingBox().Max.Y)}))
|
|
||||||
brCutout := sdf.Transform2D(blCutout, sdf.MirrorY())
|
|
||||||
tlCutout := sdf.Transform2D(blCutout, sdf.MirrorX())
|
|
||||||
trCutout := sdf.Transform2D(tlCutout, sdf.MirrorY())
|
|
||||||
walls = sdf.Difference2D(walls, blCutout)
|
|
||||||
walls = sdf.Difference2D(walls, brCutout)
|
|
||||||
walls = sdf.Difference2D(walls, tlCutout)
|
|
||||||
walls = sdf.Difference2D(walls, trCutout)
|
|
||||||
|
|
||||||
return walls
|
return walls
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue