Documentation ¶
Index ¶
- func AbutWith2D(s1, s2 sdf.SDF2, side Side) sdf.SDF2
- func AbutWith3D(s1, s2 sdf.SDF3, side Side) sdf.SDF3
- func AlignWith2D(s1, s2 sdf.SDF2, side Side) sdf.SDF2
- func AlignWith3D(s1, s2 sdf.SDF3, side Side) sdf.SDF3
- func Center2DWith3D(s1 sdf.SDF3, s2 sdf.SDF2) sdf.SDF2
- func CenterWith2D(s1, s2 sdf.SDF2) sdf.SDF2
- func CenterWith3D(s1, s2 sdf.SDF3) sdf.SDF3
- func SetOnXYPlane(s sdf.SDF3) sdf.SDF3
- func Translate2D(s sdf.SDF2, x float64, y float64) sdf.SDF2
- func Translate3D(s sdf.SDF3, x float64, y float64, z float64) sdf.SDF3
- func WrapAroundCylinder(sdf2d sdf.SDF2, innerRadius, thickness, roundInside, roundOutside float64) sdf.SDF3
- type Side
- type WrapSylinderSDF
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbutWith2D ¶
Move s2 so that its bounding box abuts the given side of s1's bounding box. Only one coordinate is ever translated.
func AbutWith3D ¶
Move s2 so that its bounding box abuts the given side of s1's bounding box. Only one coordinate is ever translated. Note that "Top" and "Bottom" refer to the Z coordinate, unlike in the 2D case where they refer to the Y coordinate. For the 3D case, "Front" refers to negative Y.
func AlignWith2D ¶
Move s2 so that the given side of its bounding box aligns with the same side of s1's bounding box.
func AlignWith3D ¶
Move s2 so that the given side of its bounding box aligns with the same side of s1's bounding box. Note that "Top" and "Bottom" refer to the Z coordinate, unlike in the 2D case where they refer to the Y coordinate. For the 3D case, "Front" refers to negative Y.
func Center2DWith3D ¶
Move s2 so that its bounding box is centered on s1's bounding box. That is, it centers the X and Y coordinates, ignoring s1's Z coordinate.
func CenterWith2D ¶
Move s2 so that its bounding box is centered on s1's bounding box.
func CenterWith3D ¶
Move s2 so that its bounding box is centered on s1's bounding box.
func Translate2D ¶
Convenience function for translating a 2D SDF, with less boilerplate
func Translate3D ¶
Convenience function for translating a 3D SDF, with less boilerplate
func WrapAroundCylinder ¶
func WrapAroundCylinder(sdf2d sdf.SDF2, innerRadius, thickness, roundInside, roundOutside float64) sdf.SDF3
Create an SDF3 by wrapping an SDF2 around a cylinder with a given thickness.
Lengths are preserved on the inside of the wrapped SDF, and points are sampled for -r/2 < x < r/2, where r is the inner radius, so if the 2D SDF is wider than the circumference of the cylinder, it will be clipped.
Both the inside and outside can be rounded independently via PolyMax.
Note that if you wish to subtract this from a cylinder (for embossing, for example), you will need to subtract the thickness from the radius you provide. So if you are trying to create a seamless embossing around the entire cylinder, you must ensure that the 2D SDF's width is the 2*pi*r, where r is that adjusted radius.
Types ¶
type WrapSylinderSDF ¶
An SDF2 wrapped around a cylinder
func (*WrapSylinderSDF) BoundingBox ¶
func (s *WrapSylinderSDF) BoundingBox() sdf.Box3