block()
The base module for generating LEGO compatible bricks, plates and boxes.
Name | Type | Description | Default Value |
---|---|---|---|
grid | Vector | A vector of two values [x, y] that define the dimensions of the brick as a multiple of a 1x1 LEGO brick in the X and Y directions. | [1, 1] |
baseSideLength | Number | The side length of a 1x1 LEGO brick in mm without side adjustment. | 8.0 |
baseHeight | Number | The base height of the brick. By default, this value corresponds to the height of a LEGO plate without the height of the knobs. Multiplying by baseLayers gives the total height of the brick. | 3.2 |
baseHeightOriginal | Number | The height of a LEGO plate without the height of the knobs. | 3.2 |
baseLayers | Number | Number of layers of the brick. Multiplied by baseHeight gives the total height of the brick. | 1 |
baseCutoutType | String | The type of the cutout on the bottom of the brick. Valid values are 'NONE', 'CLASSIC', 'GROOVE' | CLASSIC |
baseCutoutMinDepth | Number | The minimum depth of the base cutout. | 2.6 |
baseCutoutMaxDepth | Number | The maximum depth of the base cutout. | 9.0 |
baseClampHeight | Number | The height of the clamp skirt in the base cutout. | 1.2 |
baseClampThickness | Number | The horizontal thickness of the clamp skirt in the base cutout. | 0.4 |
baseRounding | string | Specifies whether the edges of the base of the stone should be rounded. Valid values are: 'none', 'all', 'xmin', 'xmax', 'ymin', 'ymax', 'zmin', 'zmax' | all |
baseRoundingRadius | Number | The radius of the base rounding. | 0.1 |
baseRoundingResolution | Number | The resolution for base roundings. | 15 |
sideAdjustment | Number | Vector | A vector with four values in mm [x1, x2, y1, y2] to be subtracted from or added to each side of the brick after the dimensions have been calculated. If a single value x is specified, this corresponds to a vector [x, x, x, x]. If a vector [x, y] is specified, this corresponds to a vector [x, x, y, y]. | -0.1 |
heightAdjustment | Number | A value in mm to subtract from or add to the final calculated base height. | 0.0 |
wallThickness | Number | The wall thickness of the brick within the base hole. | 1.2 |
wallGapsX | Vector | [] | |
wallGapsY | Number | [] | |
topPlateHeight | Number | The preferred height of the top plate of the brick. | 0.6 |
withTopPlateHelpers | Boolean | Whether to draw a thin line along the walls before drawing the top plate for better adhesion. | true |
topPlateHelperOffset | Number | The offset of the lines drawn along the y-axes. | 0.2 |
topPlateHelperHeight | Number | The vertical height of the plate helper. | 0.2 |
topPlateHelperThickness | Number | The horizontal thickness of the plate helper. | 0.4 |
withStabilizerGrid | Boolean | Whether to draw lines to connect the pillars to the walls before drawing the top plate for better brick stability. | true |
stabilizerGridOffset | Number | The offset of the pillar helper lines drawn along the Y-axes | 0.2 |
stabilizerGridHeight | Number | The vertical height of the pillar helper lines. | 0.4 |
stabilizerGridThickness | Number | The horizontal thickness of the pillar helper lines. | 0.8 |
stabilizerExpansion | Number | if greater zero, the each nth stabilizer is expanded to maximum size. | 2 |
stabilizerExpansionOffset | Number | The distance between expanded stabilizers to the bottom of the brick. | 1.8 |
withPillars | Boolean | Whether the brick should have pillar tubes / pins within the base hole. | true |
pillarGaps | String | Vector | A vector of pillar gaps defined by [x, y] tuples. If set to 'AUTO' pillar gaps are calculated automatically. | [] |
maxPillarNonGap | Number | 2 | |
middlePillarGapLimit | Number | 10 | |
pinSize | Number | The diameter of the tube pin in 1 x n and n x 1 bricks. | 3.2 |
pinClampThickness | Number | The thickness of the clamp on the pin. | 0.1 |
tubeXYSize | Number | The outer diameter of X and Y holes. | 6.5 |
tubeZSize | Number | The outer diameter of pillar tubes. | 6.5 |
tubeClampThickness | Number | The thickness of the clamp on the pillar tubes. | 0.1 |
withHolesX | Boolean | Whether the brick should have LEGO Technic holes along the X-Axis. | false |
withHolesY | Boolean | Whether the brick should have LEGO Technic holes along the Y-Axis. | false |
holeXYSize | Number | The inner diameter of X and Y holes | 5.1 |
holeXYInsetSize | Number | The diameter of the inset of X and Y holes. | 6.2 |
holeXYInsetDepth | Number | The depth of the inset of X and Y holes. | 0.9 |
withHolesZ | Boolean | Whether the brick should have LEGO Technic holes between the knobs. | false |
holeZSize | Number | The inner diameter of Z holes. | 5.1 |
holeResolution | Number | The resolution for all holes (x, y, z) and pillars (tubes, pins) | 30 |
knobType | String | The type of the knobs. Valid values are 'NONE', 'AUTO', 'CLASSIC', 'TECHNIC', 'TONGUE'. | AUTO |
knobCentered | Boolean | Whether the knobs should be centered on the brick. | false |
knobSize | Number | The diameter of the knobs. | 4.9 |
knobHeight | Number | The height of the knobs. If withPit is true, this value defines the height of the pit tongue. | 1.8 |
knobHeightOriginal | Number | The original height of the knobs. | 1.8 |
knobHoleSize | Number | The diameter of the inner knob holes if the knobs are not filled. | 3.3 |
knobHoleRounding | Number | The knob rounding. | 0.1 |
knobHoleClampThickness | Number | The thickness of the clamp inside the knob holes. | 0.1 |
knobResolution | Number | The rounding resolution of the knobs. | 30 |
knobGaps | Vector | A vector with knobs to skip. | [] |
knobTongueThickness | Number | The wall thickness of the knob tongue. | 1.2 |
knobTongueAdjustment | Number | The outer adjustment of the knob tongue. | -0.1 |
knobTongueClampThickness | Number | The thicknes of the clamp on the knob tongue. | 0.0 |
knobGrooveDepth | Number | The depth of the groove for knob tongue. | 2.6 |
withPit | Boolean | Whether the brick has a pit. | false |
pitDepth | Number | The depth of the pit. If set to zero, the depth is calculated automatically. | 0 |
pitWallThickness | Number | The wall thickness of the pit. | 2.6 |
pitWallGaps | Vector | A list of gaps in the pit walls. | [] |
withText | Boolean | Whether to draw a line of text on one wall. | false |
textFont | String | The font family name. | Helvetica Bold |
text | String | The text to draw. | Hi |
textSize | Number | The font size. | 4 |
textDepth | Number | 0.6 | |
textSide | Number | 1 | |
textOffset | Vector | A vector with horizontal and vertical text offset. | [0, 0] |
textSpacing | Number | 1 | |
screwHolesZ | Vector | [] | |
screwHoleZSize | Number | 2.3 | |
screwHoleZHelperThickness | Number | 0.8 | |
screwHoleZHelperOffset | Number | 0.2 | |
screwHoleZHelperHeight | Number | 0.2 | |
screwHolesX | Vector | [] | |
screwHolesY | Vector | [] | |
screwHoleXYSize | Number | 2.1 | |
brickOffset | Vector | The X, Y and Z offset of the brick compared to its original position. The X and Y values are specified as multiples of baseSideLength, the Z value as a multiple of originalBaseHeight. | [0, 0, 0] |
center | Boolean | If true, the brick is centered in OpenSCAD. | true |
alwaysOnFloor | Boolean | If true, the stone is always placed on the floor in OpenSCAD, even if center is set to true. | true |
alignWithAdjustment | Boolean | If false, sideAdjustment is not taken into account when positioning the brick in OpenSCAD. This is useful if you want to align multiple bricks with brickOffset so that you can use sideAdjustment to fill gaps. | false |
withAdhesionHelpers | Boolean | Whether to draw lines to connect the pillars to the walls on the first layer for better bed adhesion. | false |
adhesionHelperHeight | Number | The vertical height of the adhesion helper lines. | 0.2 |
adhesionHelperThickness | Number | The horizontal thickness of the adhesion helper lines. | 0.4 |
previewQuality | Number | Number between 0.0 and 1.0 to specify the preview rendering quality compared to final quality. | 1.0 |