package OSCADml
OCaml DSL for 3D solid modelling in OpenSCAD
Install
Dune Dependency
Authors
Maintainers
Sources
OSCADml-0.2.3.tbz
sha256=61bc12919734a42004f9f54bb03aa5403eac9cdd645cad1fb97ddd2eba148583
sha512=9aca48afeb2c89ace6b07110b6aadedac7d877fb9b0d1990b0c0b622829ff45ced3841fdae30b5b869293dea1b3ae39f1b00fc767c8e3f69d7e78f6412801ffb
doc/profile_skinning.html
Profile Skinning
open OCADml
open OSCADml
The Mesh.skin
function makes it (relatively) simple to generate meshes that cover over series of profiles. A greate simple example demonstrated by the skin modules in both list-comprehension-demos and BOSL2 is the vaccum connector.
let profiles =
let fn = 32 in
let base =
let sq = Path3.square ~center:true (v2 2. 4.) in
Path3.(roundover ~fn (Round.flat ~corner:(Round.circ (`Radius 0.5)) sq))
and c r h = Path3.ztrans h @@ Path3.circle ~fn r in
let cones = List.map (fun h -> [ c 0.6 h; c 0.5 (h +. 1.) ]) [ 4.; 5.; 6. ] in
List.flatten ([ base; Path3.ztrans 2. base; c 0.5 3.; c 0.5 4. ] :: cones)
A quick look at the points of our profiles we are about to mesh over with alternating colours may help a bit to conceptualize what we are about to give Mesh.skin
to work with.
let () =
let show i =
let c = if i mod 2 = 0 then Color.Magenta else Color.Aquamarine in
Debug.show_path3 (fun _ -> Scad.(color c @@ sphere 0.03))
in
List.mapi show profiles |> Scad.union |> Scad.to_file "vaccum_connector_points.scad"
let () =
Mesh.skin ~slices:(`Flat 0) profiles
|> Scad.of_mesh
|> Scad.to_file "vaccum_connector.scad"
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>