Last active
August 29, 2015 13:58
-
-
Save ToJans/10020386 to your computer and use it in GitHub Desktop.
My DSL is slowly getting there...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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