package
0.4.4
Repository: https://github.com/unixpickle/model3d.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
BoundsRect creates a Rect from a Bounder's bounds.
BoundsUnion computes the bounds of one or more bounder.
BoundsValid checks for numerical issues with the bounds.
BVHToCollider converts a BVH into a MultiCollider in a hierarchical way.
CacheScalarFunc creates a scalar function that is equivalent to a deterministic function f, but caches results across calls in a concurrency-safe manner.
CacheSolidBounds creates a Solid that has a cached version of the solid's boundary coordinates.
CheckedFuncSolid is like FuncSolid, but it does an automatic bounds check before calling f.
ColliderContains checks if a point is within a Collider and at least margin away from the border.
ColliderToSDF generates an SDF that uses bisection search to approximate the SDF for any Collider.
Colorize turns a grayscale image into a color image with an alpha channel.
ColorizeOverlay turns a series of grayscale images into corresponding colors and then overlays them, each on top of the last.
CurveEvalX finds the y value that occurs at the given x value, assuming that the curve is monotonic in x.
CurveInverseX gets the t value between 0 and 1 where the x value is equal to some x, assuming the curve is monotonic in x.
CurveMesh creates a mesh with n evenly-spaced segments along the curve.
CurveTranspose generates a Curve where x and y are swapped from the original c.
DecodeCSV decodes the CSV format from EncodeCSV().
EncodeCSV encodes the mesh as a CSV file.
EncodeCustomPathSVG encodes a collection of meshes each as path elements with individually specified parameters.
EncodeCustomSVG encodes multiple meshes, each with a different color and line thickness.
EncodePathSVG encodes the mesh as a single filled path in an SVG file.
EncodeSVG encodes the mesh as an SVG file.
ForceSolidBounds creates a new solid that reports the exact bounds given by min and max.
FuncPointSDF creates a PointSDF from a function.
FuncSDF creates an SDF from a function.
FuncSolid creates a Solid from a function.
GroupBounders sorts a slice of objects into a balanced bounding box hierarchy.
GroupedSegmentsToCollider converts pre-grouped segments into an efficient MultiCollider.
GroupedSegmentsToSDF creates a FaceSDF from a slice of segments.
GroupSegments is like GroupBounders, but for segments in particular.
InBounds returns true if c is contained within the bounding box of b.
MarchingSquares turns a Solid into a mesh using a 2D version of the marching cubes algorithm.
MarchingSquaresASCII turns a Solid into an ASCII-art line-drawing using a 2D version of marching cubes.
MarchingSquaresC2F computes a coarse mesh for the solid, then uses that mesh to compute a fine mesh more efficiently.
MarchingSquaresConj is like MarchingSquaresSearch, but in a transformed space.
MarchingSquaresFilter is like MarchingSquares, but does not scan rectangular areas for which f returns false.
MarchingSquaresSearch is like MarchingSquares, but applies an additional search step to move the vertices along the edges of each square.
MarchingSquaresSearchFilter combines the two methods MarchingSquaresSearch and MarchingSquaresFilter.
MeshToCollider converts a mesh to an efficient MultiCollider.
MeshToHierarchy creates a MeshHierarchy for each exterior mesh contained in m.
MeshToSDF turns a mesh into a FaceSDF.
MetaballSolid creates a Solid by smoothly combining multiple metaballs.
MustReadBitmap is like ReadBitmap, except that it panics if the bitmap cannot be read.
MustReadInterpBitmap is like ReadInterpBitmap, except that it panics if the InterpBitmap cannot be read.
NewBitmap creates an empty bitmap.
NewBitmapImage creates a Bitmap from an image, by calling c for each pixel and using the result as the bit.
NewBVHAreaDensity creates a BVH by minimizing the product of each bounding box's perimeter with the number of objects contained in the bounding box at each branch.
NewColliderSolid creates a basic ColliderSolid.
NewColliderSolidHollow creates a ColliderSolid that only reports containment around the edges.
NewColliderSolidInset creates a ColliderSolid that only reports containment at some distance from the surface.
NewConvexPolytopeRect creates a rectangular convex polytope.
NewCoordArray creates a Coord from an array of x and y.
NewCoordMap creates an empty map.
NewCoordPolar converts polar coordinates to a Coord.
NewCoordRandBounds creates a random Coord uniformly inside the given rectangular boundary.
NewCoordRandNorm creates a random Coord with normally distributed components.
NewCoordRandUniform creates a random Coord with uniformly random coordinates in [0, 1).
NewCoordRandUnit creates a random Coord with magnitude 1.
NewCoordToNumber creates an empty map.
NewCoordToSlice creates an empty map.
No description provided by the author
NewEdgeMap creates an empty map.
NewEdgeToNumber creates an empty map.
NewEdgeToSlice creates an empty map.
NewInterpBitmap creates a InterpBitmap from an image.
NewJoinedCollider creates a JoinedCollider which combines zero or more other colliders.
NewMatrix2Columns creates a Matrix2 with the given coordinates as column entries.
NewMatrix2Rotation creates a rotation matrix that rotates column vectors by theta.
NewMesh creates an empty mesh.
NewMeshPolar creates a closed polar mesh.
NewMeshRect creates a rectangle mesh.
NewMeshSegments creates a mesh with the given collection of segments.
NewRect creates a Rect with a min and a max value.
NewSolidMux creates a SolidMux using the ordered list of solids provided as arguments.
NewTriangle creates a Triangle from three points.
Ones creates the unit vector scaled by a constant.
ProjectMedialAxis projects the point c onto the medial axis of the shape defined by SDF p.
QuarticMetaballFalloffFunc implements 1/r^4 falloff.
Rasterize renders a Solid, Collider, or Mesh to an image file.
RasterizeColor is like Rasterize, but it renders multiple objects in different colors.
ReadBitmap is like NewBitmapImage, except that it reads the image from a file.
ReadInterpBitmap is like NewInterpBitmap, except that it reads the image from a file.
RotateMetaball creates a new Metaball by rotating a Metaball by a given angle (in radians).
RotateSolid creates a new Solid by rotating a Solid by a given angle (in radians).
Rotation creates a rotation transformation using an angle in radians.
SaveImage saves a rasterized image to a file, inferring the file type from the extension.
ScaleMetaball creates a new Metaball by scaling m by the factor s.
ScaleSolid creates a new Solid that scales incoming coordinates c by 1/s.
SDFToMetaball creates a Metaball from the SDF.
SDFToSolid creates a Solid which is true inside the SDF.
SmoothBezier creates a joined cubic bezier curve where control points are reflected around end-points.
SmoothJoin joins the SDFs into a union Solid and smooths the intersections using a given smoothing radius.
SmoothJoinV2 is like SmoothJoin, but uses surface normals to improve results for SDFs that intersect at obtuse angles.
TransformCollider applies t to the Collider c to produce a new, transformed Collider.
TransformMetaball applies t to the metaball m to produce a new, transformed metaball.
TransformSDF applies t to the SDF s to produce a new, transformed SDF.
TransformSolid applies t to the solid s to produce a new, transformed solid.
TranslateMetaball creates a new Metaball by translating a Metaball by a given offset.
TranslateSolid creates a new Solid by translating a Solid by a given offset.
Triangulate turns any simple polygon into a set of equivalent triangles.
TriangulateMesh creates a minimal collection of triangles that cover the enclosed region of a mesh.
VecScaleMetaball transforms the metaball m by scaling each axis by a different factor.
VecScaleSolid creates a new Solid that scales incoming coordinates c by 1/v, thus resizing the solid a variable amount along each axis.
X gets a coordinate in the X direction.
XY constructs a coordinate.
Y gets a coordinate in the Y direction.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DefaultBezierMaxSplits determines the maximum number of subdivisions when computing Bezier arc lengths.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

A BezierFitter fits Bezier curves to points.
A Bitmap is a two-dimensional image with boolean values.
BVH represents a (possibly unbalanced) axis-aligned bounding box hierarchy.
A Capsule is a shape which contains all of the points within a given distance of a line segment.
A Circle is a 2D perfect circle.
A ColliderSolid is a Solid that uses a Collider to check if points are in the solid.
A Coord is a coordinate in 2-D Euclidean space.
CoordMap implements a map-like interface for mapping Coord to T.
CoordToNumber implements a map-like interface for mapping Coord to T.
CoordToSlice implements a map-like interface for mapping Coord to []T.
A CoordTree is a k-d tree over Coords.
EdgeMap implements a map-like interface for mapping [2]Coord to T.
EdgeToNumber implements a map-like interface for mapping [2]Coord to T.
EdgeToSlice implements a map-like interface for mapping [2]Coord to []T.
An InterpBitmap is a dynamic Bitmap backed by an image with a color interpolation scheme.
A JoinedCollider wraps multiple other Colliders and only passes along rays and circles that enter their combined bounding box.
A LinearConstraint defines a half-space of all points c such that c.Dot(Normal) <= Max.
Matrix2Transform is a Transform that applies a matrix to coordinates.
A Mesh is a collection of segments.
A MeshHierarchy is a tree structure where each node is a closed, simple polygon, and children are contained inside their parents.
A Rasterizer converts 2D models into raster images.
A Ray is a line originating at a point and extending infinitely in some (positive) direction.
RayCollision is a point where a ray intersects a 2-dimensional outline.
A Rect is a 2D primitive that fills an axis-aligned rectangular space.
Scale is a transform that scales an object.
A SolidMux computes many solid values in parallel and returns a bitmap of containment for each solid.
SolidSurfaceEstimator estimates collision points and normals on the surface of a solid using search.
SubtractedSolid is a Solid consisting of all the points in Positive which are not in Negative.
Translate is a Transform that adds an offset to coordinates.
A Triangle is a 2D primitive containing all of the convex combinations of three points.
VecScale is a transform that scales an object coordinatewise.

# Interfaces

No description provided by the author
A Bounder is an object contained in an axis-aligned bounding box.
A Collider is the outline of a 2-dimensional shape.
A Curve is a parametric curve that returns points for values of t in the range [0, 1].
DistTransform is a Transform that changes Euclidean distances in a coordinate-independent fashion.
A FaceSDF is a PointSDF that can additionally get the segment containing the closest point.
A Metaball implements a field f(c) where values greater than zero indicate points "outside" of some shape, and larger values indicate points "further" away.
No description provided by the author
A NormalSDF is an SDF that can additionally get the tangent normal for the nearest point on a surface.
A PointSDF is an SDF that can additionally get the nearest point on a surface.
A RectCollider is a 2-dimensional outline which can detect if a 2D axis-aligned rectangular area collides with the outline.
An SDF is a signed distance function.
A SegmentCollider is a 2-dimensional outline which can detect if a line segment collides with the outline.
A Solid is a boolean function where a value of true indicates that a point is part of the solid, and false indicates that it is not.
Transform is an invertible coordinate transformation.

# Type aliases

BezierCurve implements an arbitrarily high-dimensional Bezier curve.
ColorBitFunc turns colors into single bits.
A ConvexPolytope is the intersection of some linear constraints.
Interpolator is a 1-dimensional interpolation kernel.
IntersectedSolid is a Solid containing the intersection of one or more Solids.
A JoinedCurve combines Curves into a single curve.
A JoinedSolid is a Solid composed of other solids.
A JoinedTransform composes transformations from left to right.
Matrix2 is a 2x2 matrix, stored in row-major order.
MetaballFalloffFunc is a function that determines how the influence of metaballs falls off outside their surface.
A Segment is a 2-dimensional line segment.