opensolid/geometry/3.0.0

NOTE: this package is not compatible with Elm 0.19.1

SketchPlane3d

SketchPlane3d

A SketchPlane3d represents a 2D planar coordinate system in 3D space, and is defined by its origin point and X and Y directions (which are always perpendicular to each other). Sketch planes are the primary tool for converting back and forth between 2D and 3D coordinates:

  • 3D geometry such as points, directions and line segments can be projected into a sketch plane, which effectively projects the geometry onto the sketch plane and then expresses the projected geometry in 2D coordinates.
  • 2D geometry can be place onto a sketch plane to result in 3D geometry. For example, a 2D point placed onto a sketch plane will result in a 3D point on that sketch plane that has the given 2D coordinate in the sketch plane.

This allows you to create algorithms that project from 3D into 2D, perform some calculations in 2D, then convert the result back to 3D.

Many 3D data types have projectInto functions that return the corresponding 2D data type, and on functions for converting back to 3D. For example, Triangle3d.projectInto returns a Triangle2d and Triangle3d.on returns a Triangle3d.

type alias SketchPlane3d =
SketchPlane3d

Constants

These predefined sketch planes all have the global origin point as their origin point, and use the two indicated global axes as their X and Y axes.

xy : SketchPlane3d
yx : SketchPlane3d
yz : SketchPlane3d
zy : SketchPlane3d
zx : SketchPlane3d
xz : SketchPlane3d

Constructors

Sketch planes can also be constructed from Frame3d values using Frame3d.xySketchPlane etc.

withNormalDirection : Direction3d -> Point3d -> SketchPlane3d
on : SketchPlane3d -> Frame2d -> SketchPlane3d
throughPoints : Point3d -> Point3d -> Point3d -> Maybe SketchPlane3d
fromPlane : Plane3d -> SketchPlane3d
{ originPoint : Point3d
, xDirection : Direction3d
, yDirection : Direction3d
}
-> SketchPlane3d

Conversions

toPlane : SketchPlane3d -> Plane3d

Properties

originPoint : SketchPlane3d -> Point3d
xDirection : SketchPlane3d -> Direction3d
yDirection : SketchPlane3d -> Direction3d
normalDirection : SketchPlane3d -> Direction3d
xAxis : SketchPlane3d -> Axis3d
yAxis : SketchPlane3d -> Axis3d
normalAxis : SketchPlane3d -> Axis3d

Transformations

offsetBy : Float -> SketchPlane3d -> SketchPlane3d
reverseX : SketchPlane3d -> SketchPlane3d
reverseY : SketchPlane3d -> SketchPlane3d
moveTo : Point3d -> SketchPlane3d -> SketchPlane3d
rotateAround : Axis3d -> Float -> SketchPlane3d -> SketchPlane3d
rotateAroundOwn : (SketchPlane3d -> Axis3d) -> Float -> SketchPlane3d -> SketchPlane3d
translateBy : Vector3d -> SketchPlane3d -> SketchPlane3d
translateIn : Direction3d -> Float -> SketchPlane3d -> SketchPlane3d
translateAlongOwn : (SketchPlane3d -> Axis3d) -> Float -> SketchPlane3d -> SketchPlane3d
mirrorAcross : Plane3d -> SketchPlane3d -> SketchPlane3d

Coordinate conversions

relativeTo : Frame3d -> SketchPlane3d -> SketchPlane3d
placeIn : Frame3d -> SketchPlane3d -> SketchPlane3d