Documentation ¶
Overview ¶
Package toolbox3d provides a collection of parts for building practical 3D models for 3D prints.
Index ¶
Constants ¶
const ( AxisX = 0 AxisY = 1 AxisZ = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AxisSqueeze ¶
type AxisSqueeze struct { // The axis to compress. Axis Axis // Bounds on the axis to compress. Min float64 Max float64 // This is (new length / old length). // For example, if we use a squeeze ratio of 0.1, // then squeezing 2 inches will bring it down to // 0.2 inches. Ratio float64 }
AxisSqueeze is a coordinate transformation which squeezes some section of space into a much smaller amount of space along some axis.
AxisSqueeze can be used to efficiently produce meshes which are mostly uniform along some axis, for example a tall cylinder.
func (*AxisSqueeze) Apply ¶
func (a *AxisSqueeze) Apply(c model3d.Coord3D) model3d.Coord3D
Apply squeezes the coordinate.
func (*AxisSqueeze) ApplyBounds ¶
func (a *AxisSqueeze) ApplyBounds(min, max model3d.Coord3D) (newMin, newMax model3d.Coord3D)
ApplyBounds squeezes the bounds.
func (*AxisSqueeze) Inverse ¶
func (a *AxisSqueeze) Inverse() model3d.Transform
Inverse creates an AxisSqueeze that undoes the squeeze performed by a.
type Equirect ¶
type Equirect struct {
// contains filtered or unexported fields
}
An Equirect is an equirectangular bitmap representing colors on a sphere.
It can be used, for example, to aid in implementing a 3D polar function.
func NewEquirect ¶
NewEquirect creates an Equirect from an image. It is assumed that the top of the image is north (positive latitude), the bottom of the image is south, the left is west (negative longitude), the right is east (positive longitude).
type GearProfile ¶
func InvoluteGearProfile ¶
func InvoluteGearProfile(pressureAngle, module, clearance float64, numTeeth int) GearProfile
InvoluteGearProfile creates a GearProfile for a standard involute gear with the given specs.
func InvoluteGearProfileSizes ¶
func InvoluteGearProfileSizes(pressureAngle, module, addendum, dedendum float64, numTeeth int) GearProfile
InvoluteGearProfileSizes creates an involute gear profile using different parameters than InvoluteGearProfile.
type HelicalGear ¶
func (*HelicalGear) Max ¶
func (h *HelicalGear) Max() model3d.Coord3D
func (*HelicalGear) Min ¶
func (h *HelicalGear) Min() model3d.Coord3D
type Ramp ¶
type Ramp struct { model3d.Solid // P1 is the tip of the ramp, where the scale is 0. // Any point further in the direction of P1 will have // a scale of zero. P1 model3d.Coord3D // P2 is the base of the ramp, where the scale is 1. // Any point further in the direction of P2 will have // a scale of one. P2 model3d.Coord3D }
A Ramp wraps an existing solid and gradually increases the scale of the solid from 0% to 100% along a given axis.
This makes it easier to make shapes like upside-down pyramids and cones for use in FDM printing without supports.
type ScrewSolid ¶
type ScrewSolid struct { // P1 is the center of the start of the screw. P1 model3d.Coord3D // P2 is the center of the end of the screw. P2 model3d.Coord3D // Radius is the maximum radius of the screw, // including grooves. Radius float64 // GrooveSize is the size of the grooves. // This may not exceed Radius. GrooveSize float64 // Pointed can be set to true to indicate that the tip // at the P2 end should be cut off at a 45 degree // angle (in the shape of a cone). // Can be used for internal screw holes to avoid // support. Pointed bool }
A ScrewSolid is a model3d.Solid implementation of screws. It can also be used for screw holes, by combining it with model3d.SubtractedSolid.
Screws are similar to cylinders, so many of the fields are analogous to model3d.CylinderSolid.
func (*ScrewSolid) Max ¶
func (s *ScrewSolid) Max() model3d.Coord3D
func (*ScrewSolid) Min ¶
func (s *ScrewSolid) Min() model3d.Coord3D