Skip to content

Instantly share code, notes, and snippets.

@ToJans
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToJans/10020386 to your computer and use it in GitHub Desktop.
Save ToJans/10020386 to your computer and use it in GitHub Desktop.
My DSL is slowly getting there...
let frame_old (size:Vector3D) =
let beamThickness = VerandaOpts.unit.beamUnit.z
let horizontalGeometry = CubeGeometry <| Vector3D.fromDecimal (size.x-beamThickness*2M) beamThickness size.z
let horizontalObject = Object3D.mesh horizontalGeometry ShinyStuff
let width = size.y - beamThickness |> DY
let topBeam = horizontalObject + width.half
let bottomBeam = horizontalObject - width.half
let verticalGeometry = CubeGeometry <| Vector3D.fromDecimal beamThickness size.y size.z
let verticalObject = Object3D.mesh verticalGeometry ShinyStuff
let height = size.x - beamThickness |> DX
let leftBeam = verticalObject + height.half
let rightBeam = verticalObject - height.half
Object3D.objects [leftBeam;rightBeam;topBeam;bottomBeam]
let frame (size: Vector3D) =
let beamUnit = VerandaOpts.unit.beamUnit
let horizontalBeam = CubeGeometry {beamUnit with x = size.x}
let verticalBeam = CubeGeometry {beamUnit with y = size.y - beamUnit.y * 2M}
let topBeam = PositionedGeometry.create horizontalBeam
let leftBeam = topBeam.attach verticalBeam BottomLeftFront TopLeftFront
let bottomBeam = leftBeam.attach horizontalBeam BottomLeftFront TopLeftFront
let rightBeam = topBeam.attach verticalBeam BottomRightFront TopRightFront
[topBeam;leftBeam;bottomBeam;rightBeam]
|> List.map(fun (x)-> Object3D.positionedMesh x ShinyStuff)
|> Object3D.objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment