Operations

Shape formo::translate(const Shape &shape, const Vector &v)

Translate a shape.

Parameters:
  • shapeShape to translate

  • v – Translation vector

Returns:

Translated shape

Shape formo::translate(const Shape &shape, const Point &p1, const Point &p2)

Translate a shape.

Parameters:
  • shapeShape to translate

  • p1Point one of the translation vector

  • p2Point two of the translation vector

Returns:

Translated shape

Shape formo::scale(const Shape &shape, double s)

Scale a shape.

Parameters:
  • shapeShape to scale

  • s – Scale factor

Returns:

Scaled shape

Vector formo::scale(const Vector &vec, double s)

Scale a vector.

Parameters:
  • vecVector to scale

  • s – Scale factor

Returns:

Scaled vector

Shape formo::mirror(const Shape &shape, const Axis1 &axis)

Mirror a shape about an axis.

Parameters:
  • shapeShape to mirror

  • axis – Axis to mirror about

Returns:

Resulting shape

Vector formo::mirror(const Vector &vector, const Axis1 &axis)

Mirror a vector about an axis.

Parameters:
  • shapeVector to mirror

  • axis – Axis to mirror about

Returns:

Resulting vector

Vector formo::mirror(const Vector &vector, const Axis2 &axis)

Mirror a vector about an axis.

Parameters:
  • shapeVector to mirror

  • axis – Axis to mirror about

Returns:

Resulting vector

Point formo::mirror(const Point &point, const Axis1 &axis)

Mirror a point about an axis.

Parameters:
  • pointPoint to mirror

  • axis – Axis to mirror about

Returns:

Resulting point

Point formo::mirror(const Point &point, const Axis2 &axis)

Mirror a point about an axis.

Parameters:
  • pointPoint to mirror

  • axis – Axis to mirror about

Returns:

Resulting point

Shape formo::fuse(const Shape &shape, const Shape &tool)

Fuse 2 shapes.

Parameters:
  • shapeShape

  • tool – Tool

Returns:

Resulting fused shape

Shape formo::cut(const Shape &shape, const Shape &tool)

Cut a shape with a tool.

Parameters:
  • shapeShape to cut

  • tool – Cutting tool

Returns:

Resulting shape

Shape formo::intersect(const Shape &shape, const Shape &tool)

Intersect 2 shapes.

Parameters:
  • shapeShape

  • tool – Tool

Returns:

Resulting shape

Shape formo::fillet(const Shape &shape, const std::vector<Edge> &edges, double radius)

Fillet.

Parameters:
  • shapeShape to fillet

  • edges – List of edges to fillet

  • radius – Radius of the fillet

Returns:

Resulting shape

Shape formo::hollow(const Shape &shape, const std::vector<Face> &faces_to_remove, double thickness, double tolerance)

Hollow the shape.

Parameters:
  • shapeShape to hollow

  • faces_to_remove – Faces to open

  • thickness – Desired wall thickness

  • tolerance – Tolerance

Returns:

Hollowed out shape

Shape formo::extrude(const Shape &shape, const Vector &vec)

Extrude a shape.

Parameters:
  • shapeShape to extrude

  • vecVector of extrusion

Returns:

Resulting shape

Shape formo::revolve(const Shape &shape, const Axis1 &axis, double angle = 2. * M_PI)

Revolve shape about an axis.

Parameters:
  • shapeShape to revolve

  • axis – Axis to revolve about

  • angle – Angle to revolve

Returns:

Resulting shape

Point formo::rotate(const Point &point, const Axis1 &axis, double angle)

Rotate point about an axis.

Parameters:
  • pointPoint to rotate

  • axis – Axis to rotate about

  • angle – Rotation angle (in radians)

Returns:

Resulting Point

Vector formo::rotate(const Vector &vector, const Axis1 &axis, double angle)

Rotate vector about an axis.

Parameters:
  • vectorVector to rotate

  • axis – Axis to rotate about

  • angle – Rotation angle (in radians)

Returns:

Resulting vector

Shape formo::rotate(const Shape &point, const Axis1 &axis, double angle)

Rotate a shape about an axis.

Parameters:
  • shapeShape to rotate

  • axis – Axis to rotate about

  • angle – Rotation angle (in radians)

Returns:

Resulting Shape

Wire formo::section(const Shape &shape, const Plane &plane)

Compute section between a shape and a plane.

Parameters:
Returns:

Wire that forms the computed section

Shape formo::draft(const Shape &shape, const Plane &pln, const std::vector<Face> &faces, double angle)

Taper-adding transformations on a shape.

The resulting shape is constructed by defining one face to be tapered after another one, as well as the geometric properties of their tapered transformation. Each tapered transformation is propagated along the series of faces which are tangential to one another and which contains the face to be tapered.

Parameters:
  • shapeShape to taper

  • pln – Neutral plane

  • faces – Faces to taper

  • angle – Tapering angle

Returns:

Tapered shape

Shape formo::hole(const Shape &shape, const Axis1 &axis, double radius)

Make cylindrical hole on a shape.

Parameters:
  • shapeShape on which hole will be performed

  • axis – Axis of the hole

  • radius – Radius of the hole

Shape formo::hole(const Shape &shape, const Axis1 &axis, double radius, double length)

Make cylindrical hole on a shape with specified depth.

Parameters:
  • shapeShape on which hole will be performed

  • axis – Axis of the hole

  • radius – Radius of the hole

  • length – Length of the hole

Shape formo::sweep(const Shape &profile, const Wire &spine)

Constructs a pipe by sweeping the profile along the spine

Parameters:
  • profile – Profile to sweep

  • spine – Sweep path

Returns:

Resulting shape