Create Basic Shape
Basic shape include box, cylinder, cone/frustum, sphere, and torus.
Box
AMCAX::MakeBox class provides functionality to create a box.
Class of making a box.
Definition MakeBox.hpp:18
Base class of shape, containing an underlying shape with a location and an orientation.
Definition TopoShape.hpp:15
PointT< double, 3 > Point3
3D point
Definition PointT.hpp:459
Cylinder
AMCAX::MakeCylinder class provides functionality to create a cylinder.
Class of making a cylinder.
Definition MakeCylinder.hpp:16
DirectionT< double, 3 > Direction3
3D direction
Definition DirectionT.hpp:587
FrameT< double, 3 > Frame3
3D frame
Definition FrameT.hpp:885
Cone/Frustum
AMCAX::MakeCone class provides functionality to create a cone or frustum.
Class of making a cone.
Definition MakeCone.hpp:16
Sphere
AMCAX::MakeSphere class provides functionality to create a sphere.
Class of making a sphere.
Definition MakeSphere.hpp:16
Torus
AMCAX::MakeTorus class provides functionality to create a torus.
Class of making a torus.
Definition MakeTorus.hpp:19
Boolean Operation
Boolean operation functionalities include union, intersection, cut, split, and section.
Union
AMCAX::BoolBRepFuse class provides the union functionality.
The class of fuse operation.
Definition BoolBRepFuse.hpp:15
Intersection
AMCAX::BoolBRepCommon class provides the intersection functionality.
The class of common operation.
Definition BoolBRepCommon.hpp:14
Cut
AMCAX::BoolBRepCut class provides the cut functionality.
The class of cut operation.
Definition BoolBRepCut.hpp:15
Split
AMCAX::BoolBRepSplitter class provides the split functionality.
auto tool_shape = std::list{ shape1 };
auto tool_argument = std::list{ shape2 };
The class of splitter operation.
Definition BoolBRepSplitter.hpp:16
AMCAX_API void SetTools(const std::list< TopoShape > &ls)
Set the tool shapes.
AMCAX_API void SetArguments(const std::list< TopoShape > &listargs)
Set the shapes to be processed.
virtual AMCAX_API const TopoShape & Shape()
Get the resulting shape.
Section
AMCAX::BoolBRepSection provides functionality to calculate the section line.
The class of section operation.
Definition BoolBRepSection.hpp:17
Extrude (Sweep) Creation Functionality
AMCAX::MakePrism provides the extrude (sweep) functionality.
std::shared_ptr<AMCAX::Geom3Curve> curve = makeEllipse.Value();
Class of making an edge.
Definition MakeEdge.hpp:24
Class of making a face.
Definition MakeFace.hpp:22
Class of making 3D geometric ellipses.
Definition MakeGeom3Ellipse.hpp:13
Class of making a prism or an extrusion shape.
Definition MakePrism.hpp:16
Class of making a wire.
Definition MakeWire.hpp:17
Class of edge.
Definition TopoEdge.hpp:12
Class of face.
Definition TopoFace.hpp:12
Class of wire.
Definition TopoWire.hpp:12
VectorT< double, 3 > Vector3
3D vector
Definition VectorT.hpp:707
Rotation (Sweep) Creation Functionality
AMCAX::MakeRevol class provides the rotation (sweep) functionality.
auto bz = std::make_shared<AMCAX::Geom3BezierCurve>(poles);
static AMCAX_API const Axis3 & OZ() noexcept
Get the z-axis in 3D, including the origin and the z-direction.
Class of making a revolved shape.
Definition MakeRevol.hpp:18
Pipe Functionality
The pipe is created by specifying the spine (wire) and profile (shape). This can be done using AMCAX::MakePipe or AMCAX::MakePipeShell. MakePipe is for simpler pipe algorithms, suitable for a single section (planar shape) and a smooth path. MakePipeShell is a more complete pipe algorithm, supporting multiple sections and non-smooth paths, but the path must intersect with the section plane. Note that Add can only be TopoWire or TopoVertex.
double radius = 0.1;
std::vector<AMCAX::Point3> pointSet;
ps.Add(aWire,false,false);
ps.Build();
Class of make pipe algorithm.
Definition MakePipe.hpp:20
Class of making pipe shell algorithm.
Definition MakePipeShell.hpp:35
static AMCAX_API std::shared_ptr< Geom3BSplineCurve > InterpolatePoints(const std::vector< Point3 > &points, int degree=3, bool isClosed=false, ApproxParameterizationType ptype=ApproxParameterizationType::ChordLength)
The curve which interpolate the points is constructed.
CircleS< 3 > Circle3
3D circle
Definition CircleT.hpp:178
@ Centripetal
Parameters of points are proportional to square roots of distances between them.
Definition ApproxParameterizationType.hpp:17
Loft Operation
AMCAX::MakeLoft class provides loft functionality. By adding multiple wires, a shell or solid can be lofted.
aMakeLoft.AddWire(bottomWire);
aMakeLoft.AddWire(topWire);
aMakeLoft.Build();
Class of making a lofting shape.
Definition MakeLoft.hpp:30
Class of making a polygon.
Definition MakePolygon.hpp:18
static AMCAX_API const TopoWire & Wire(const TopoShape &s)
Cast shape to wire.
TransformationT< double, 3 > Transformation3
3D transformation
Definition TransformationT.hpp:1102
Fillet and Chamfer Features (Support Variable Radius)
Fillet
Fillet replaces sharp edges with smooth surfaces. The AMCAX::MakeFillet class and the AMCAX::MakeFillet2d class provide fillet functionality.
MakeFillet
mf.Build();
Template class of indexed set.
Definition IndexSet.hpp:20
The class of fillet.
Definition MakeFillet.hpp:23
static AMCAX_API const TopoEdge & Edge(const TopoShape &s)
Cast shape to edge.
MakeFillet2d
mf2d.Build();
Class of make fillet and chamfer on a vertex of a planar face.
Definition MakeFillet2d.hpp:20
static AMCAX_API const TopoVertex & Vertex(const TopoShape &s)
Cast shape to vertex.
static AMCAX_API const TopoFace & Face(const TopoShape &s)
Cast shape to face.
Chamfer
AMCAX::MakeChamfer class provides the chamfer functionality.
mc.Build();
The class of chamfer.
Definition MakeChamfer.hpp:20
Shape Offset Function
The AMCAX::MakeOffset class and AMCAX::MakeOffsetShape class provide the functionality for shape offset.
MakeOffset (Offset for 2D Shapes)
The input is a wire for offset, and for a face, the boundary of the face is offset, returning the wire after offset.
double offset = 1.5;
bool isOpenResult = false;
MakeOffset.Perform(offset);
MakeOffset2.Perform(offset);
Class of making offset wires.
Definition MakeOffset.hpp:19
JoinType
Type of join.
Definition GeometryMacros.hpp:74
MakeOffsetShape (Offset for 3D Shapes)
Input face for offset, input shell for offset the entire solid, returning the offset face or solid.
double offsetvalue = 1.2;
MakeOffsetShape2.
Build();
Class of build a shell out of a shape algorithm.
Definition MakeOffsetShape.hpp:18
AMCAX_API void PerformBySimple(const TopoShape &s, double offsetValue)
Construct an offset shape using the simple algorithm without intersections computation.
AMCAX_API void Build() override
Perform the algorithm.
Shape Thicken
AMCAX::MakeThickSolid class provides the functionality to thicken shape.
double offsetvalue=1.5;
Class of making a thick solid shape.
Definition MakeThickSolid.hpp:12
AMCAX_API void Build() override
Perform the algorithm.
AMCAX_API void MakeThickBySimple(const TopoShape &s, double offsetValue)
Make a thick solid using simple algorithm, only for a non-closed single face or shell which contain t...
Replace Face
The AMCAX::BoolBRepReplaceFace class provides the functionality to replace a face. This allows you to select a face from a solid and replace it with another surface. The basic logic involves extending the surrounding faces of the replaced face, intersecting them with the new surface, and reconstructing the topology. If the surface cannot cover the replaced face, the replacement will fail.
std::shared_ptr<AMCAX::Geom3Plane> surf = std::make_shared<AMCAX::Geom3Plane>(plane);
{
}
The class of replace the feature faces in solid with surface.
Definition BoolBRepReplaceFace.hpp:17
AMCAX_API void SetReplaceSurface(const std::shared_ptr< Geom3Surface > &surface)
Set the surface with which the feature face is replaced.
AMCAX_API void AddFaceToReplace(const TopoShape &face)
Adds the face to be replaced from the input shape;.
AMCAX_API void SetShape(const TopoShape &shape)
Set the shape for replace face feature algorithm.
AMCAX_API void Build() override
Perform the algorithm.
virtual AMCAX_API bool IsDone() const
Is the construction algorithm done.
Class of Plane.
Definition Plane.hpp:13
Thin Plate Spline Interpolation of Curves
When interpolating, it is apparent that the curve passing through these points is not unique.
Generally speaking, the blue curve is more in line with the CAD design intent than the green one. To ensure the curve has a manageable length and the curvature changes smoothly, we use the thin-plate energy to measure the quality of the curve:
E1 controls the length of the curve, and E2 controls the rate of change of the curve. The larger the alpha, the shorter the curve. The larger the beta, the smoother the curve's shape. The AMCAX::NURBSAPIInterpolate class provides functionality for thin-plate spline interpolation. Details are as follows:
AMCAX::NURBSAPIInterpolate::InterpolatePointsThinPlate:Takes input data point coordinates, corresponding curve parameters (optional), and some information about the interpolation curve (periodicity, thin-plate energy weight), and constructs a NURBS curve passing through each data point while minimizing the thin-plate energy.
AMCAX::NURBSAPIInterpolate::InterpolateNodesThinPlate:Takes input data point coordinates, gradient orders (optional), corresponding curve parameters (optional), and some information about the interpolation curve (periodicity, thin-plate energy weight), and constructs a NURBS curve passing through each data point while minimizing the thin-plate energy.
std::vector<AMCAX::Point3> points;
bool isClosed = false;
double alpha = 1e-2;
double beta = 1e-2;
std::vector< double > parameterization = { 0.0,0.1,0.2,0.3,0.4,0.5 };
std::vector<AMCAX::InterpolationNode> nodes;
nodes.push_back({ p1,true,v1,false,v2 });
nodes.push_back({ p2,true,v1,false,v2 });
std::vector<double> parameterization1{ 0.0,0.5 };
Class of constant law function.
Definition LawConstant.hpp:12
static AMCAX_API std::shared_ptr< Geom3BSplineCurve > InterpolateNodesThinPlate(const std::vector< InterpolationNode > &nodes, bool isClosed=false, ApproxParameterizationType ptype=ApproxParameterizationType::ChordLength, double alpha=1e-3, double beta=1e-3)
The curve which interpolate the points with gradients is constructed with Thin Plate Energy.
static AMCAX_API std::shared_ptr< Geom3BSplineCurve > InterpolatePointsThinPlate(const std::vector< Point3 > &points, bool isClosed, ApproxParameterizationType ptype, double alpha, double beta)
Interpolate points to make a BSpline curve with Thin Plate Energy.
ApproxParameterizationType
Type of the parameterization used in curve approximation.
Definition ApproxParameterizationType.hpp:12
@ ChordLength
Parameters of points are proportional to distances between them.
Definition ApproxParameterizationType.hpp:14
Convert Law Curve to 3D Geometric Curve
Using AMCAX::LawFunction::ToCurve() to convert a law curve to a 3D geometric curve.
For example, using a constant value function, r corresponds to the value of y, and pf and pl are the start and end parameters of x.
double r = 5.0;
double pr = 1.0;
double pl = 10.0;
AMCAX_API void Set(double r, double pf, double pl)
Set the parameters.
AMCAX_API std::shared_ptr< Geom3Curve > ToCurve() const override
Turn the law function to a curve.
Some images are sourced from: https://dev.opencascade.org/doc/overview/html/index.html , the copyright belongs to its owner.