Higher-level shape construction helpers for the PicoGK geometry kernel
Dependencies
| File | Description |
|---|---|
| shapes.mbt | Shape construction helpers |
| Function | Description |
|---|---|
| hollow_sphere | Sphere with inner sphere subtracted |
| connected_hollow_spheres | Two hollow spheres joined together |
| flat_cylinder | Cylinder approximation (capsule-based) |
| box_shape | Axis-aligned box |
| torus | Donut shape (ring of capsules) |
| sphere_grid | 3D array of spheres |
| cylinder_ring | Ring of cylinders |
| perforate | Grid of holes in a solid |
| lattice_cage | Beam-and-node lattice from corners |
import "@gmlewis/picogkshapes" as shapes
fn main {
// Create a perforated plate
let plate = shapes.box_shape(-50.0, -50.0, -2.0, 50.0, 50.0, 2.0)
let perforated = shapes.perforate(
plate,
Vec3::{ x: 0.0, y: 0.0, z: 0.0 },
10.0, 10.0, 10, 10, 2.0, 4.0,
)
plate.destroy()
// ... use perforated plate
perforated.destroy()
}pub struct Cylinder {
frame : LocalFrame
length : Double
radius : (Double, Double) -> Double
frames : Frames?
polar_steps : Int
radial_steps : Int
length_steps : Int
}pub struct ImplicitGyroid {
unit_size : Double
thickness_ratio : Double
frequency : Double
}pub struct ImplicitSuperEllipsoid {
center : Vec3
ax : Double
ay : Double
az : Double
e1 : Double
e2 : Double
}pub struct LatticeManifold {
frame : LocalFrame
length : Double
radius : (Double) -> Double
frames : Frames?
l_steps : Int
max_overhang_angle : Double
extend_both_sides : Bool
min_printable_radius : Double
}pub struct LatticePipe {
frame : LocalFrame
length : Double
radius : (Double) -> Double
frames : Frames?
l_steps : Int
}pub struct Lens {
frame : LocalFrame
height : Double
inner_radius : Double
outer_radius : Double
lower : (Double, Double) -> Double
upper : (Double, Double) -> Double
radial_steps : Int
polar_steps : Int
height_steps : Int
}pub struct LineModulation {
fn_ : (Double) -> Double
}pub struct RGB {
r : Double
g : Double
b : Double
}pub struct Ring {
frame : LocalFrame
ring_radius : Double
radius : (Double, Double) -> Double
radial_steps : Int
polar_steps : Int
}pub struct Sphere {
frame : LocalFrame
radius : (Double, Double) -> Double
azim_steps : Int
polar_steps : Int
transform : (Array[Vec3]) -> Array[Vec3]?
}fn SurfaceMeshBuilder::add(self : SurfaceMeshBuilder, grid : Array[Array[Vec3]], flip : Bool) -> SurfaceMeshBuilderpub struct SurfaceModulation {
fn_ : (Double, Double) -> Double
}pub struct Vec3 {
x : Double
y : Double
z : Double
}fn new_box(frame : LocalFrame?, length : Double, width : (Double) -> Double, depth : (Double) -> Double) -> Boxfn new_color_scale_3d(spectrum : Array[RGB], min_value : Double, max_value : Double) -> ColorScale3Dfn new_control_point_spline(control_points : Array[Vec3], degree : Int, closed : Bool) -> ControlPointSplinefn new_cylinder(frame : LocalFrame?, length : Double, radius : (Double, Double) -> Double) -> Cylinderfn new_implicit_super_ellipsoid(center : Vec3, ax : Double, ay : Double, az : Double, e1 : Double, e2 : Double) -> ImplicitSuperEllipsoidfn new_lattice_manifold(frame : LocalFrame, length : Double, radius : Double, max_overhang_angle : Double) -> LatticeManifoldfn new_lattice_pipe(frame : LocalFrame?, length : Double, radius : (Double) -> Double) -> LatticePipefn new_lattice_pipe_with_frames(frame : LocalFrame?, length : Double, radius : (Double) -> Double, fs : Frames) -> LatticePipefn new_lens(frame : LocalFrame?, height : Double, inner_radius : Double, outer_radius : Double) -> Lensfn new_lens_with_mods(frame : LocalFrame?, height : Double, inner_radius : Double, outer_radius : Double, lower : (Double, Double) -> Double, upper : (Double, Double) -> Double) -> Lensfn new_pipe(frame : LocalFrame?, length : Double, inner_radius : (Double, Double) -> Double, outer_radius : (Double, Double) -> Double) -> Pipefn new_pipe_segment(frame : LocalFrame?, length : Double, inner_radius : (Double, Double) -> Double, outer_radius : (Double, Double) -> Double, start : (Double) -> Double, end : (Double) -> Double, method_name : String) -> PipeSegmentfn new_pipe_segment_with_frames(frame : LocalFrame?, length : Double, inner_radius : (Double, Double) -> Double, outer_radius : (Double, Double) -> Double, start : (Double) -> Double, end : (Double) -> Double, method_name : String, fs : Frames) -> PipeSegmentfn new_pipe_with_frames(frame : LocalFrame?, length : Double, inner_radius : (Double, Double) -> Double, outer_radius : (Double, Double) -> Double, fs : Frames) -> Pipefn surf_from_line(line : (Double) -> Double, line_arg : String) -> ((Double, Double) -> Double)Higher-level shape construction helpers for the PicoGK geometry kernel
Dependencies