ParaScript
workspace.para
Language
RUN SOLVER
DOWNLOAD STL
setup { name: "Car", units: "mm", coordinate_system: "Z-up" } parameters { body: { width: 100.0, depth: 200.0, height: 20.0 }, cabin: { width: 80.0, depth: 70.0, height: 32.0, overlap: 8.0 }, wheel: { radius: 12.0, width: 14.0, ride: 8.0 }, axle: { nose: 42.0, wheelbase: 120.0 } } def Axle = host => y => let track = $body.width - $wheel.width in let with_left = Component( solid: join( frame: host, placed: Cylinder(radius: $wheel.radius, height: $wheel.width), using: frame => placed => align( planar: meet( frame: frame.right, placed: placed.up), translation: meet( frame: frame.at.offset( x: $wheel.width / 2.0, y: y, z: $wheel.radius - $wheel.ride), placed: placed.center), rotation: meet( frame: frame.up, placed: placed.forward) ), combine: frame => placed => frame + placed ), expose: coords => { up: Vector(coords: coords, x: 0.0, y: 0.0, z: 1.0), right: Vector(coords: coords, x: 1.0, y: 0.0, z: 0.0), at: Vector(coords: coords, x: 0.0, y: 0.0, z: 0.0) } ) in Component( solid: join( frame: with_left, placed: Cylinder(radius: $wheel.radius, height: $wheel.width), using: frame => placed => align( planar: meet( frame: frame.right, placed: placed.up), translation: meet( frame: frame.at.offset( x: $wheel.width / 2.0 + track, y: y, z: $wheel.radius - $wheel.ride), placed: placed.center), rotation: meet( frame: frame.up, placed: placed.forward) ), combine: frame => placed => frame + placed ), expose: coords => { up: Vector(coords: coords, x: 0.0, y: 0.0, z: 1.0), right: Vector(coords: coords, x: 1.0, y: 0.0, z: 0.0), at: Vector(coords: coords, x: 0.0, y: 0.0, z: 0.0) } ) def Car = let body = Box( width: $body.width, depth: $body.depth, height: $body.height) in let cabin = Box( width: $cabin.width, depth: $cabin.depth, height: $cabin.height) in let hull = Component( solid: join( frame: body, placed: cabin, using: frame => placed => align( planar: meet( frame: frame.up, placed: placed.up), translation: meet( frame: frame.top.offset(x: 0.0, y: 0.0, z: 0.0 - $cabin.overlap), placed: placed.bottom), rotation: meet( frame: frame.right, placed: placed.right) ), combine: frame => placed => frame + placed ), expose: coords => { up: Vector(coords: coords, x: 0.0, y: 0.0, z: 1.0), right: Vector(coords: coords, x: 1.0, y: 0.0, z: 0.0), at: Vector(coords: coords, x: 0.0, y: 0.0, z: 0.0) } ) in let with_front = Axle( host: hull, y: $body.depth - $axle.nose) in Axle( host: with_front, y: $body.depth - $axle.nose - $axle.wheelbase) export(Car)
Model
Solid sides
Drag to turn. Pinch to zoom. Two fingers pan.