opensolid/geometry/1.2.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.

circle3d : Circle3d -> Value

Encode a Circle3d as an object with centerPoint, axialDirection and radius fields.

arc2d : Arc2d -> Value

Encode an Arc2d as an object with centerPoint, startPoint and sweptAngle fields.

arc3d : Arc3d -> Value

Encode an Arc3d as an object with axis, startPoint and sweptAngle fields.

quadraticSpline2d : QuadraticSpline2d -> Value

Encode a QuadraticSpline2d as a list of three control points.

quadraticSpline3d : QuadraticSpline3d -> Value

Encode a QuadraticSpline3d as a list of three control points.

cubicSpline2d : CubicSpline2d -> Value

Encode a CubicSpline2d as a list of four control points.

cubicSpline3d : CubicSpline3d -> Value

Encode a CubicSpline3d as a list of four control points.