FlowCad is the fast, free, and precise web app for 3D design and printing. Build professional parametric models with ease-no programming required, but it's there if you need it.
/*
* Header Pin Blueprint
* Converted to Manifold-3D standard
*/
// 1. Define Defaults (Used for UI discovery)
const PARAMS = {
dim: 'disabled',
pinWidth: 0.65,
plasticSize: 2.54,
topHeight: 3.0,
bottomHeight: 6.0,
}
// 2. Extract parameters
const { pinWidth, plasticSize, topHeight, bottomHeight } = PARAMS
// Calculate the total length of the metal pin
const pinHeight = topHeight + bottomHeight + plasticSize
// 3. Construct parts
// Create the metal pin centered at origin
let pin = Manifold.cube([pinWidth, pinWidth, pinHeight], true)
// Calculate vertical shift to align with plastic block at origin
// This ensures that the plastic part stays at Z=0
const pinZOffset = -pinHeight / 2 + plasticSize / 2 + topHeight
// Apply translation to the pin
pin = pin.translate([0, 0, pinZOffset])
// Create the plastic insulator block centered at origin
const plasticBox = Manifold.cube([plasticSize, plasticSize, plasticSize], true)
// 4. Combine parts
// Boolean union of the pin and the plastic insulator
const result = pin.add(plasticBox)
// 5. Return result and current parameters
return { result, PARAMS }