opensolid/geometry/1.1.0

NOTE: this package is not compatible with Elm 0.19.1

OpenSolid.Geometry.Encode

JSON encoders for the core OpenSolid types.

vector2d : Vector2d -> Value

Encode a Vector2d as a list of two floating-point components.

vector3d : Vector3d -> Value

Encode a Vector3d as a list of three floating-point components.

direction2d : Direction2d -> Value

Encode a Direction2d as a list of two floating-point components.

direction3d : Direction3d -> Value

Encode a Direction3d as as a list of three floating-point components.

point2d : Point2d -> Value

Encode a Point2d as as a list of two floating-point coordinates.

point3d : Point3d -> Value

Encode a Point3d as as a list of three floating-point coordinates.

axis2d : Axis2d -> Value

Encode an Axis2d as an object with originPoint and direction fields.

axis3d : Axis3d -> Value

Encode an Axis3d as an object with originPoint and direction fields.

plane3d : Plane3d -> Value

Encode a Plane3d as an object with originPoint and normalDirection fields.

frame2d : Frame2d -> Value

Encode a Frame2d as an object with originPoint, xDirection and yDirection fields.

frame3d : Frame3d -> Value

Encode a Frame3d as an object with originPoint, xDirection, yDirection and zDirection fields.

sketchPlane3d : SketchPlane3d -> Value

Encode a SketchPlane3d as an object with originPoint, xDirection and yDirection fields.

lineSegment2d : LineSegment2d -> Value

Encode a LineSegment2d as a list of two endpoints.

lineSegment3d : LineSegment3d -> Value

Encode a LineSegment3d as a list of two endpoints.

triangle2d : Triangle2d -> Value

Encode a Triangle2d as a list of three vertices.

triangle3d : Triangle3d -> Value

Encode a Triangle3d as a list of three vertices.

boundingBox2d : BoundingBox2d -> Value

Encode a BoundingBox2d as an object with minX, maxX, minY and maxY fields.

boundingBox3d : BoundingBox3d -> Value

Encode a BoundingBox3d as an object with minX, maxX, minY, maxY, minZ and maxZ fields.

polyline2d : Polyline2d -> Value

Encode a Polyline2d as a list of points.

polyline3d : Polyline3d -> Value

Encode a Polyline3d as a list of points.

polygon2d : Polygon2d -> Value

Encode a Polygon2d as a list of points.

circle2d : Circle2d -> Value

Encode a Circle2d as an object with centerPoint and radius fields.