package OSCADml
OCaml DSL for 3D solid modelling in OpenSCAD
Install
Dune Dependency
Authors
Maintainers
Sources
OSCADml-0.2.1.tbz
sha256=406e45c5df8122e8b065342e10ba9deb7a066683b256619462c405da69ba5baa
sha512=20db4192d6204d9fd5914562ec83d8edbbb1f5c89a72e61928bf662fdcc9ecea38760b26c99af801ddfc5b877c451ad11c16fc89a6a36ef8c20881375627295b
doc/cartesian_gravity_well.html
Cartesian Gravity Well
open OCADml
open OSCADml
Define a function from x
and y
coordinates to z
height of the xy plane.
let gravity_well ~x ~y =
let z = 50. -. (50. /. Float.sqrt ((x *. x) +. (y *. y))) in
if z < 1. then 1. else z
Evaluate gravity_well
, producing a mesh with the resulting height at each point of the grid defined by the xy bound and step parameters.
let mesh =
Mesh.cartesian_plot
~min_x:(-10.)
~x_steps:30
~max_x:0.
~min_y:(-10.)
~y_steps:60
~max_y:10.
gravity_well
Convert our mesh into an OpenSCAD polyhedron and output to file.
let () = Scad.to_file "cartesian_gravity_well.scad" (Scad.of_mesh mesh)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>