Shapes
-
class Point : public formo::Shape
Defines a 3D cartesian point.
Public Functions
-
Point(double x, double y, double z)
Creates a point with its 3 cartesian coordinates.
- Parameters:
x – x-coordinate
y – y-coordinate
z – z-coordinate
-
double x() const
X-coordinate of this point.
-
double y() const
Y-coordinate of this point.
-
double z() const
Z-coordinate of this point.
-
double distance(const Point &pt) const
Computes the distance between two points.
- Parameters:
pt – Point to measure distance to
- Returns:
Distance between this point and
pt
-
void mirror(const Point &pt)
Performs the symmetrical transformation of a point with respect to the point
pt
which is the center of the symmetry.- Parameters:
pt – Point of symmetry
-
void mirror(const Axis1 &ax1)
Performs the symmetrical transformation of a point with respect to an axis placement which is the axis of the symmetry.
- Parameters:
ax1 – Axis placement
-
void mirror(const Axis2 &ax2)
Performs the symmetrical transformation of a point with respect to a plane.
- Parameters:
ax2 – The axis placement ax2 locates the plane of the symmetry
-
Point mirrored(const Point &pt) const
Performs the symmetrical transformation of a point with respect to the point
pt
which is the center of the symmetry.- Parameters:
pt – Point of symmetry
- Returns:
Mirrored point
-
Point mirrored(const Axis1 &ax1) const
Performs the symmetrical transformation of a point with respect to an axis placement which is the axis of the symmetry.
- Parameters:
ax1 – Axis placement
- Returns:
Mirrored point
-
Point mirrored(const Axis2 &ax2) const
Performs the symmetrical transformation of a point with respect to a plane.
- Parameters:
ax2 – The axis placement ax2 locates the plane of the symmetry
- Returns:
Mirrored point
-
void rotate(const Axis1 &ax1, double angle)
Rotate the point.
- Parameters:
ax1 – The axis of the rotation.
angle – The angular value of the rotation in radians.
-
Point rotated(const Axis1 &ax1, double angle) const
Rotate the point.
- Parameters:
ax1 – The axis of the rotation.
angle – The angular value of the rotation in radians.
- Returns:
Rotate point
-
void scale(const Point &pt, double s)
Scales a point.
- Parameters:
pt – Point that the scaling is relative to
s – The scaling value.
-
Point scaled(const Point &pt, double s) const
Scales a point.
- Parameters:
pt – Point that the scaling is relative to
s – The scaling value.
- Returns:
Scaled point
-
void translate(const Vector &vec)
Translates a point in the direction of the vector
vec
.The magnitude of the translation is the vector’s magnitude.
- Parameters:
vec – The vector of translation
-
void translate(const Point &p1, const Point &p2)
Translates a point from point
p1
to pointp2
- Parameters:
p1 – First point
p2 – Second point
-
Point(double x, double y, double z)
-
class Circle : public formo::Edge
Describes a circle in 3D space.
A circle is defined by its radius and positioned in space with a coordinate system.
Public Functions
-
Circle(const Axis2 &origin, double radius)
Construct a circle from an origin and a radius.
- Parameters:
origin – Center point
radius – Radius
-
Circle(const Point ¢er, double radius, const Direction &normal = Direction(0., 0., 1.))
Construct a circle from a center point and a radius.
- Parameters:
center – Center point
radius – Radius
norm – Normal of the plane
-
Circle(const Point ¢er, const Point &pt, const Direction &norm = Direction(0., 0., 1.))
Construct a circle from a center point and another point.
- Parameters:
center – Center point
pt – Point that is part of the circle
norm – Normal of the plane
-
Circle(const Point &pt1, const Point &pt2, const Point &pt3)
Construct a circle from three points.
- Parameters:
pt1 – First point
pt2 – Second point
pt3 – Third point
-
double area() const
Get circle area.
- Returns:
Area of the circle
-
double radius() const
Get radius.
- Returns:
Radius
-
Circle(const Axis2 &origin, double radius)
-
class ArcOfCircle : public formo::Edge
Describes an arc of a circle in 3D space.
Public Functions
-
ArcOfCircle(const Point &pt1, const Point &pt2, const Point &pt3)
Construct an arc of a circle from trhee points.
- Parameters:
pt1 – First point
pt2 – Second point
pt3 – Third point
-
ArcOfCircle(const Circle &circ, const Point &pt1, const Point &pt2, bool sense = true)
Construct an arc of a circle from a circle and 2 points on the circle.
- Parameters:
circ – Circle
pt1 – First point
pt2 – Second point
sense – Sense of the circle
-
ArcOfCircle(const Point &pt1, const Point &pt2, const Point &pt3)
-
class Polygon : public formo::Wire
Subclassed by formo::CircumscribedPolygon, formo::InscribedPolygon
-
class Shape
Subclassed by formo::Edge, formo::Face, formo::Point, formo::Prism, formo::Shell, formo::Solid, formo::Wire
-
class Edge : public formo::Shape
Subclassed by formo::ArcOfCircle, formo::Circle, formo::Helix, formo::Line, formo::Spline
Public Functions
-
double length() const
Compute the length of the edge.
- Returns:
Length of the edge
-
double length() const
-
class Wire : public formo::Shape
Subclassed by formo::Polygon
Public Functions
-
double length() const
Compute the length of the edge.
- Returns:
Length of the edge
-
double length() const
-
class Face : public formo::Shape
Public Functions
-
double area() const
Compute the area of the face.
- Returns:
Area of the face
-
double area() const
-
class Solid : public formo::Shape
Subclassed by formo::Box, formo::Cone, formo::Cylinder, formo::Sphere
Public Functions
-
double volume() const
Compute the volume of the shape.
- Returns:
Volume of the shape
-
double volume() const