造型工具集 更多...
#include <APIBrepTools.h>
Public 成员函数 | |
TopoShape | LoadFile (const Path &strFile) |
bool | SaveFile (const TopoShapeGroup &shapeGroup, const Path &strFileName) |
bool | SaveFile (const TopoShape &shape, const Path &strFileName) |
TopoShape | LoadBuffer (const CharBuffer &buffer) |
CharBuffer | SaveBuffer (const TopoShape &shape) |
String | ToJson (const TopoShapeGroup &meshGroup, Real precision) |
TopoShape | MakePoint (const Vector3 &position) |
TopoShape | MakeLine (const Vector3 &start, const Vector3 &end) |
TopoShape | MakeCircle (const Vector3 ¢er, double radius, const Vector3 &dir) |
TopoShape | MakeEllipse (const Vector3 ¢er, double majorRadius, double minorRadius, const Vector3 &dir) |
TopoShape | MakeArc (const Vector3 &start, const Vector3 &end, const Vector3 ¢er, const Vector3 &dir) |
TopoShape | MakeArc (const Vector3 ¢er, Real radius, Real startAngle, Real endAngle, const Vector3 &dir) |
TopoShape | MakeArc3Pts (const Vector3 &start, const Vector3 &end, const Vector3 &middle) |
TopoShape | MakeEllipseArc (const Vector3 ¢er, Real majorRadius, Real minorRadius, Real startAngle, Real endAngle, const Vector3 &dir) |
TopoShape | MakeSpline (const Vector3List &pts) |
TopoShape | MakeSpline (const TopoShapeGroup &edges) |
TopoShape | MakeSpiralCurve (Real radius, Real interval, Real count, const Coordinate3 &coord) |
TopoShape | MakePolyline (const Vector3List &pts) |
TopoShape | MakePolygon (const Vector3List &pts) |
TopoShape | MakePolygon (const Vector3List &pts, Real radius) |
TopoShape | MakeRectangle (Real len, Real width, Real radius, const Coordinate3 &coord) |
TopoShape | MakeFan (Real radius, Real startAngle, Real endAngle, const Coordinate3 &coord) |
TopoShape | MakeFan (const Vector2 &start, Real angle, const Coordinate3 &coord) |
TopoShape | MakeMeshShell (const Vector3List &pts) |
TopoShape | MakeWire (const TopoShapeGroup &edges) |
TopoShape | MakeWire (const TopoShape &edge) |
TopoShape | MakeWire (const TopoShape &edge1, const TopoShape &edge2) |
TopoShape | MakeFace (const TopoShape &wire) |
TopoShape | AddHole (const TopoShape &face, const TopoShape &hole) |
TopoShape | MakePlaneFace (const Vector3 &origion, const Vector3 &dir, Real minU, Real maxU, Real minV, Real maxV) |
TopoShape | MakeSurfaceFromPoints (const Vector3List &arrPoints, int m, int n) |
TopoShape | FillFace (const Vector3List &polygon) |
TopoShape | MakeShell (const TopoShapeGroup &faces) |
TopoShape | MakeSolid (const TopoShapeGroup &faceShells) |
TopoShape | MakeCompound (const TopoShapeGroup &shapes) |
TopoShape | MakeCompound (const TopoShape &shape1, const TopoShape &shape2) |
TopoShape | MakeSphere (const Vector3 ¢er, double radius) |
TopoShape | MakeBox (const Vector3 &start, const Vector3 &dir, const Vector3 &size) |
TopoShape | MakeBox (const Vector3 &start, const Vector3 &end, double width, double height) |
TopoShape | MakeCylinder (const Vector3 ¢er, const Vector3 &dir, double radius, double height, double degree) |
TopoShape | MakeCone (const Vector3 ¢er, const Vector3 &dir, double radius, double height, double radiusTop, double degree) |
TopoShape | MakeTube (const Vector3 ¢er, const Vector3 &dir, double radius, double thickness, double len) |
TopoShape | MakeHalfSpace (const TopoShape &face, const Vector3 &refPoint) |
TopoShape | BooleanAdd (const TopoShape &pShapeA, const TopoShape &pShapeB) |
TopoShape | BooleanCut (const TopoShape &pShapeA, const TopoShape &pShapeB) |
TopoShape | BooleanCommon (const TopoShape &pShapeA, const TopoShape &pShapeB) |
TopoShape | MakeSplit (const TopoShape &pShape, const TopoShape &splitter) |
TopoShape | MakeSplit (const TopoShape &pShape, const TopoShapeGroup &splitters) |
TopoShape | BodySection (const TopoShape &pBody, const Vector3 &pos, const Vector3 &dir) |
TopoShape | SurfaceSection (const TopoShape &pSurfA, const TopoShape &pSurfB) |
TopoShape | Extrude (const TopoShape &pShape, double height, const Vector3 &dir) |
TopoShape | Revol (const TopoShape &pShape, const Vector3 &position, const Vector3 &dir, double degree) |
TopoShape | Fillet (const TopoShape &pShape, double radius) |
TopoShape | MakeFillet (const TopoShape &shape, const IntList &edgeIdx, const FloatList &radius) |
TopoShape | Chamfer (const TopoShape &pShape, double dis1, double dis2) |
TopoShape | MakeChamfer (const TopoShape &shape, const IntList &edgeIdx, const FloatList &dis1, const FloatList &dis2) |
TopoShape | MakeLoft (const TopoShapeGroup &shapes, bool bSolid) |
TopoShape | MakeLoft (const TopoShape &wire1, const TopoShape &wire2, bool bSolid) |
TopoShape | Sweep (const TopoShape §ion, const TopoShape &path, bool bSolid) |
TopoShape | MakePipe (const TopoShape §ion, const TopoShape &path, int mode) |
TopoShape | MakePipe (const TopoShapeGroup §ions, const TopoShape &path, int mode) |
TopoShape | MakeThicken (const TopoShape &shell, Real offset, int jointType) |
TopoShape | MakeOffsetWire (const TopoShape &shape, Real offset, int jointType, bool openning) |
TopoShape | MakeOffsetShape (const TopoShape &shape, Real offset, int jointType) |
TopoShape | ProjectOnPlane (const TopoShape &shape, const Vector3 &planePosition, const Vector3 &planeDir, const Vector3 &projDir) |
TopoShape | ProjectOnSurface (const TopoShape &curve, const TopoShape &surface) |
TopoShape | MakeMirror (const TopoShape &pShape, const Vector3 &startPt, const Vector3 &endPt) |
TopoShape | Translate (const TopoShape &pShape, const Vector3 &vec) |
TopoShape | Scale (const TopoShape &pShape, const Vector3 ¢er, double scale) |
TopoShape | Rotation (const TopoShape &pShape, const Vector3 &dir, double degree) |
TopoShape | Rotation (const TopoShape &pShape, const Vector3 &axisPos, const Vector3 &axisDir, double degree) |
TopoShape | Transform (const TopoShape &pShape, const Matrix4 &trf) |
TopoShape | Transform (const TopoShape &pShape, const Coordinate3 &coord) |
TopoShape | MakeRoad (const Vector3 &start, const Vector3 &end, double width, double height, double heightMiddle, bool bSolid) |
TopoShape | MakeDish (Real radius, Real height, const Vector3 &position) |
静态 Public 成员函数 | |
static TopoShape | ConnectEdges (const TopoShapeGroup &edges) |
造型工具集
提供基本的方法创建基本体、布尔运算、特征造型等。
在面上使用闭合的Wire挖个洞洞。
face | the face to add hole. |
hole | should be closed wire or edge. |
TopoShape AnyCAD::API::BrepTools::BodySection | ( | const TopoShape & | pBody, |
const Vector3 & | pos, | ||
const Vector3 & | dir | ||
) |
计算一个平面与某个体的剖面
pBody | the body |
pos | the position of the plane |
dir | the direction of the plane |
|
static |
Connect edges to wire
edges | the edges |
TopoShape AnyCAD::API::BrepTools::Extrude | ( | const TopoShape & | pShape, |
double | height, | ||
const Vector3 & | dir | ||
) |
创建拉伸体。
pShape | can be edge/wire or planar face |
height | >0 |
dir | the direction |
TopoShape AnyCAD::API::BrepTools::FillFace | ( | const Vector3List & | polygon | ) |
填充多边形面. May not be planar.
polygon | the vertices of the polygon. |
TopoShape AnyCAD::API::BrepTools::LoadBuffer | ( | const CharBuffer & | buffer | ) |
TopoShape AnyCAD::API::BrepTools::MakeArc | ( | const Vector3 & | start, |
const Vector3 & | end, | ||
const Vector3 & | center, | ||
const Vector3 & | dir | ||
) |
创建圆弧
start | the start point |
end | the end point |
center | the center |
dir | the dir of the circle |
TopoShape AnyCAD::API::BrepTools::MakeArc | ( | const Vector3 & | center, |
Real | radius, | ||
Real | startAngle, | ||
Real | endAngle, | ||
const Vector3 & | dir | ||
) |
创建圆弧
center | the center |
radius | the radius. |
startAngle | the start angle |
endAngle | the end angle |
dir | the normal |
TopoShape AnyCAD::API::BrepTools::MakeArc3Pts | ( | const Vector3 & | start, |
const Vector3 & | end, | ||
const Vector3 & | middle | ||
) |
使用圆弧上的三个点创建圆弧。
start | the start point |
end | the end point |
middle | the middle point |
TopoShape AnyCAD::API::BrepTools::MakeBox | ( | const Vector3 & | start, |
const Vector3 & | end, | ||
double | width, | ||
double | height | ||
) |
Create Box
start | the start point |
end | the end point |
width | > 0 |
height | > 0 |
TopoShape AnyCAD::API::BrepTools::MakeChamfer | ( | const TopoShape & | shape, |
const IntList & | edgeIdx, | ||
const FloatList & | dis1, | ||
const FloatList & | dis2 | ||
) |
对体上指定的边进行倒角。
shape | the body |
edgeIdx | the index of the edges |
dis1 | the dis of each edges |
dis2 | the dis2 of each edges |
TopoShape AnyCAD::API::BrepTools::MakeCompound | ( | const TopoShapeGroup & | shapes | ) |
TopoShape AnyCAD::API::BrepTools::MakeCompound | ( | const TopoShape & | shape1, |
const TopoShape & | shape2 | ||
) |
Combine two TopoShapes
shape1 | the 1st shape |
shape2 | the 2nd shape |
TopoShape AnyCAD::API::BrepTools::MakeCone | ( | const Vector3 & | center, |
const Vector3 & | dir, | ||
double | radius, | ||
double | height, | ||
double | radiusTop, | ||
double | degree | ||
) |
创建圆锥体。
center | the center |
dir | the direction |
radius | > 0 |
height | > 0 |
radiusTop | >=0 |
degree | [0~360] |
TopoShape AnyCAD::API::BrepTools::MakeCylinder | ( | const Vector3 & | center, |
const Vector3 & | dir, | ||
double | radius, | ||
double | height, | ||
double | degree | ||
) |
创建圆柱体。
center | the center |
dir | the direction |
radius | > 0 |
height | > 0 |
degree | [0~360] |
Create disk
radius | the radius |
height | the height |
position | the location. |
TopoShape AnyCAD::API::BrepTools::MakeEllipse | ( | const Vector3 & | center, |
double | majorRadius, | ||
double | minorRadius, | ||
const Vector3 & | dir | ||
) |
创建椭圆
center | the center |
majorRadius | the major radius |
minorRadius | the minor radius |
dir | the direction |
TopoShape AnyCAD::API::BrepTools::MakeEllipseArc | ( | const Vector3 & | center, |
Real | majorRadius, | ||
Real | minorRadius, | ||
Real | startAngle, | ||
Real | endAngle, | ||
const Vector3 & | dir | ||
) |
创建椭圆弧
center | the center |
majorRadius | the major radius |
minorRadius | the minor radius |
startAngle | the start angle |
endAngle | the end angle |
dir | the normal |
使用平面上的闭合的曲线创建平面。
wire | must be closed and planar |
TopoShape AnyCAD::API::BrepTools::MakeFan | ( | Real | radius, |
Real | startAngle, | ||
Real | endAngle, | ||
const Coordinate3 & | coord | ||
) |
创建扇形。
radius | the arc radius |
startAngle | the start angle by degree. |
endAngle | the end angle by degree. |
coord | the local coordinate. |
TopoShape AnyCAD::API::BrepTools::MakeFan | ( | const Vector2 & | start, |
Real | angle, | ||
const Coordinate3 & | coord | ||
) |
创建扇形。
start | the start position to the origion of the local coordinate. |
angle | the end angle by degree. |
coord | the local coordinate. |
TopoShape AnyCAD::API::BrepTools::MakeFillet | ( | const TopoShape & | shape, |
const IntList & | edgeIdx, | ||
const FloatList & | radius | ||
) |
对体上指定的边进行倒角。
shape | Body |
edgeIdx | the index of the edges |
radius | the radius of each edge. |
TopoShape AnyCAD::API::BrepTools::MakeHalfSpace | ( | const TopoShape & | face, |
const Vector3 & | refPoint | ||
) |
Make half face: an infinite solid, limited by a surface.
face | Face or Shell |
refPoint | specifies the side of the surface where the matter of the half-space is located. |
TopoShape AnyCAD::API::BrepTools::MakeLoft | ( | const TopoShapeGroup & | shapes, |
bool | bSolid | ||
) |
TopoShape AnyCAD::API::BrepTools::MakeLoft | ( | const TopoShape & | wire1, |
const TopoShape & | wire2, | ||
bool | bSolid | ||
) |
使用两条边来进行放样。.
wire1 | the first wires |
wire2 | the second wire |
bSolid | true to make solid |
TopoShape AnyCAD::API::BrepTools::MakeMeshShell | ( | const Vector3List & | pts | ) |
TopoShape AnyCAD::API::BrepTools::MakeMirror | ( | const TopoShape & | pShape, |
const Vector3 & | startPt, | ||
const Vector3 & | endPt | ||
) |
计算镜像的对象。
pShape | the input shape |
startPt | the start point |
endPt | the end point |
TopoShape AnyCAD::API::BrepTools::MakeOffsetShape | ( | const TopoShape & | shape, |
Real | offset, | ||
int | jointType | ||
) |
Offset the face, shell or solid.
shape | be face, shell or solid. |
offset | the distance. |
jointType | 0: by arc, 1: by tangent 2: by intersection |
TopoShape AnyCAD::API::BrepTools::MakeOffsetWire | ( | const TopoShape & | shape, |
Real | offset, | ||
int | jointType, | ||
bool | openning | ||
) |
Offset the planar wire.
shape | be wire or edge. |
offset | the distance. |
jointType | 0: by arc, 1: by tangent 2: by intersection |
openning | get closed wire if false. |
TopoShape AnyCAD::API::BrepTools::MakePipe | ( | const TopoShape & | section, |
const TopoShape & | path, | ||
int | mode | ||
) |
创建管状扫略体。 Mode: TM_Transformed, TM_RightCorner, TM_RoundCorner
section | the section wire |
path | the sweep path, must be wire |
mode | the transition mode |
TopoShape AnyCAD::API::BrepTools::MakePipe | ( | const TopoShapeGroup & | sections, |
const TopoShape & | path, | ||
int | mode | ||
) |
创建有多个截面组成的扫略体。 Mode: TM_Transformed, TM_RightCorner, TM_RoundCorner
sections | the section wire |
path | the sweep path, must be wire |
mode | the transition mode |
TopoShape AnyCAD::API::BrepTools::MakePlaneFace | ( | const Vector3 & | origion, |
const Vector3 & | dir, | ||
Real | minU, | ||
Real | maxU, | ||
Real | minV, | ||
Real | maxV | ||
) |
创建平面。
origion | center position |
dir | the direction |
minU | the min value of U |
maxU | the max value of U |
minV | the min value of V |
maxV | the max value of V |
TopoShape AnyCAD::API::BrepTools::MakePolygon | ( | const Vector3List & | pts | ) |
TopoShape AnyCAD::API::BrepTools::MakePolygon | ( | const Vector3List & | pts, |
Real | radius | ||
) |
TopoShape AnyCAD::API::BrepTools::MakePolyline | ( | const Vector3List & | pts | ) |
TopoShape AnyCAD::API::BrepTools::MakeRectangle | ( | Real | len, |
Real | width, | ||
Real | radius, | ||
const Coordinate3 & | coord | ||
) |
创建矩形,可带圆角。
len | the length |
width | the width |
radius | the round angle radius |
coord | the local coordinate. |
TopoShape AnyCAD::API::BrepTools::MakeRoad | ( | const Vector3 & | start, |
const Vector3 & | end, | ||
double | width, | ||
double | height, | ||
double | heightMiddle, | ||
bool | bSolid | ||
) |
Make road line shape
start | the start point |
end | the end point |
width | the width |
height | the height |
heightMiddle | the middle height |
bSolid | if make solid. |
TopoShape AnyCAD::API::BrepTools::MakeShell | ( | const TopoShapeGroup & | faces | ) |
TopoShape AnyCAD::API::BrepTools::MakeSolid | ( | const TopoShapeGroup & | faceShells | ) |
TopoShape AnyCAD::API::BrepTools::MakeSpiralCurve | ( | Real | radius, |
Real | interval, | ||
Real | count, | ||
const Coordinate3 & | coord | ||
) |
创建弹簧曲线。
radius | the radius. |
interval | the interval |
count | the loop count |
coord | the local coordinate. |
TopoShape AnyCAD::API::BrepTools::MakeSpline | ( | const Vector3List & | pts | ) |
TopoShape AnyCAD::API::BrepTools::MakeSpline | ( | const TopoShapeGroup & | edges | ) |
把多条线合成一条Spline。
edges | the edge list. |
TopoShape AnyCAD::API::BrepTools::MakeSplit | ( | const TopoShape & | pShape, |
const TopoShape & | splitter | ||
) |
使用一个模型分割另外一个模型。
pShape | the shape to be slitted |
splitter | the splitter tool |
TopoShape AnyCAD::API::BrepTools::MakeSplit | ( | const TopoShape & | pShape, |
const TopoShapeGroup & | splitters | ||
) |
使用多个模型分割一个模型。
pShape | the shape to be slitted |
splitters | the splitter tool group |
TopoShape AnyCAD::API::BrepTools::MakeSurfaceFromPoints | ( | const Vector3List & | arrPoints, |
int | m, | ||
int | n | ||
) |
使用 M * N 的点集拟合Spline曲面。
arrPoints | the points. the size of points is equal M*N. |
m | the row length. M >= 1 |
n | the column length. N >=1 |
TopoShape AnyCAD::API::BrepTools::MakeThicken | ( | const TopoShape & | shell, |
Real | offset, | ||
int | jointType | ||
) |
Thicken the shell/face to solid.
shell | the base shape. |
offset | the thickness of the solid. |
jointType | 0: by arc, 1: by tangent 2: by intersection |
TopoShape AnyCAD::API::BrepTools::MakeTube | ( | const Vector3 & | center, |
const Vector3 & | dir, | ||
double | radius, | ||
double | thickness, | ||
double | len | ||
) |
创建直管。
center | the center |
dir | the direction |
radius | the inner radius. (> 0) |
thickness | the thickness. (>0) |
len | the length.(> 0) |
TopoShape AnyCAD::API::BrepTools::MakeWire | ( | const TopoShapeGroup & | edges | ) |
把一条边转成Wire。
edge | the edge |
把两条可以链接在一起的边组成一条Wire
edge1 | the first edge |
edge2 | the second edge |
TopoShape AnyCAD::API::BrepTools::ProjectOnPlane | ( | const TopoShape & | shape, |
const Vector3 & | planePosition, | ||
const Vector3 & | planeDir, | ||
const Vector3 & | projDir | ||
) |
计算wire在平面上投影曲线。
shape | should be edge or wire |
planePosition | the plane position |
planeDir | the direction of the plane |
projDir | the direction of projection |
TopoShape AnyCAD::API::BrepTools::ProjectOnSurface | ( | const TopoShape & | curve, |
const TopoShape & | surface | ||
) |
计算Wire在曲面上的投影曲线。
curve | should be edge. |
surface | should be face. |
TopoShape AnyCAD::API::BrepTools::Revol | ( | const TopoShape & | pShape, |
const Vector3 & | position, | ||
const Vector3 & | dir, | ||
double | degree | ||
) |
创建回转体。
pShape | can be edge/wire or planar face |
position | the position of the Axis |
dir | the direction of the Axis |
degree | the revoled angle (0, 360] |
CharBuffer AnyCAD::API::BrepTools::SaveBuffer | ( | const TopoShape & | shape | ) |
bool AnyCAD::API::BrepTools::SaveFile | ( | const TopoShapeGroup & | shapeGroup, |
const Path & | strFileName | ||
) |
把 TopoShapeGroup 保存为文件。
shapeGroup | the shapes to save |
strFileName | the full file path |
把TopoShape保存到文件。
shape | the shape to save |
strFileName | the full file path |
TopoShape AnyCAD::API::BrepTools::Sweep | ( | const TopoShape & | section, |
const TopoShape & | path, | ||
bool | bSolid | ||
) |
创建扫略体或者面
section | the section profile |
path | the sweep path, must be wire |
bSolid | if true to make solid |
String AnyCAD::API::BrepTools::ToJson | ( | const TopoShapeGroup & | meshGroup, |
Real | precision | ||
) |
Convert TopoShapeGroup as Json
meshGroup | the meshes to save |
precision | the precision of mesh |
TopoShape AnyCAD::API::BrepTools::Transform | ( | const TopoShape & | pShape, |
const Coordinate3 & | coord | ||
) |