opensolid/geometry/3.0.1

NOTE: this package is not compatible with Elm 0.19.1

LineSegment3d

LineSegment3d

A LineSegment3d is a line between two points in 3D. This module contains functionality such as:

  • Interpolating within a line segment or measuring its length
  • Scaling, rotating, translating, mirroring or projecting a line segment
  • Converting a line segment between local and global coordinates in different reference frames
type alias LineSegment3d =
LineSegment3d

Constructors

fromEndpoints : ( Point3d, Point3d ) -> LineSegment3d
from : Point3d -> Point3d -> LineSegment3d
along : Axis3d -> Float -> Float -> LineSegment3d
on : SketchPlane3d -> LineSegment2d -> LineSegment3d

Properties

startPoint : LineSegment3d -> Point3d
endPoint : LineSegment3d -> Point3d
endpoints : LineSegment3d -> ( Point3d, Point3d )
midpoint : LineSegment3d -> Point3d
length : LineSegment3d -> Float
squaredLength : LineSegment3d -> Float
direction : LineSegment3d -> Maybe Direction3d
perpendicularDirection : LineSegment3d -> Maybe Direction3d
vector : LineSegment3d -> Vector3d
boundingBox : LineSegment3d -> BoundingBox3d

Interpolation

interpolate : LineSegment3d -> Float -> Point3d

Transformations

reverse : LineSegment3d -> LineSegment3d
scaleAbout : Point3d -> Float -> LineSegment3d -> LineSegment3d
rotateAround : Axis3d -> Float -> LineSegment3d -> LineSegment3d
translateBy : Vector3d -> LineSegment3d -> LineSegment3d
translateIn : Direction3d -> Float -> LineSegment3d -> LineSegment3d
mirrorAcross : Plane3d -> LineSegment3d -> LineSegment3d
projectOnto : Plane3d -> LineSegment3d -> LineSegment3d
mapEndpoints : (Point3d -> Point3d) -> LineSegment3d -> LineSegment3d

Coordinate conversions

relativeTo : Frame3d -> LineSegment3d -> LineSegment3d
placeIn : Frame3d -> LineSegment3d -> LineSegment3d
projectInto : SketchPlane3d -> LineSegment3d -> LineSegment2d