You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.0 KiB

# PMClassifier
用于计算Extrusion体在空间查询点处的SDF
## Extrusion体描述
- 沿多段线路径拉伸
```C++
class ExtrudedSolidPolyline {
/**
* @brief Construct a new extruded solid using a polyline as the axis
* @param profiles The profiles of the extruded solid
* @param axis The axis of the extruded solid
* @param rScale The radius scale of the extruded solid, unused for now
*/
ExtrudedSolidPolyline(std::vector<Polyline> profiles, Polyline axis, real rScale = 1.0);
}
```
- 沿单段线路径拉伸
```C++
class ExtrudeSolidArcLine : public ExtrudedSolidPolyline {
public:
/**
* @brief Construct a new extruded solid using an arc line as the axis
* @param profiles The profiles of the extruded solid
* @param axis The axis of the extruded solid
* @param rScale The radius scale of the extruded solid, unused for now
*/
ExtrudeSolidArcLine(std::vector<Polyline> profiles, ArcLine axis, real rScale = 1.0);
};
```
- 沿螺旋路径拉伸
```C++
class ExtrudedSolidHelixLine {
public:
/**
* @brief Construct a new extruded solid using a helix as the axis
* @param profiles The profiles of the extruded solid (still polyline)
* @param axis The axis of the extruded solid
* @param rScale The radius scale of the extruded solid, unused for now
*/
ExtrudedSolidHelixLine(std::vector<Polyline> profiles, HelixLine axis, real rScale = 1.0);
};
```
## 曲线描述
- 多段线
```C++
using Pt3Array = std::vector<Vec3>;
class Polyline {
public:
/**
* @brief Construct a new Polyline object
* @param points The points of the polyline
* @param bugles The bugles of the polyline
* @param refNormal The reference normal of the polyline
* @param closed Whether the polyline is closed
*/
Polyline(Pt3Array points, std::vector<real> bugles, const Vec3 &refNormal, bool closed = false);
}
```
- 单段线/圆弧线
```C++
class ArcLine : public Polyline {
public:
/**
* @brief Construct a new ArcLine object
* @param a The start point of the arc line
* @param b The end point of the arc line
* @param bugle The bugle of the arc line
* @param refNormal The reference normal of the arc line
*/
ArcLine(const Vec3 &a, const Vec3 &b, real bugle, const Vec3 &refNormal);
};
```
- 螺旋线
```C++
class HelixLine : public ILine {
public:
/**
* @brief Construct a new HelixLine object
* @param axisStart The start point of the helix line
* @param axisEnd The end point of the helix line
* @param r The radius of the helix line
* @param advancePerRound The advance per round of the helix line
* @param startDir The direction from axisStart to start of the helix line
*/
HelixLine(const Vec3 &axisStart, const Vec3 &axisEnd, real r, real advancePerRound,
const Vec3 &startDir);
}
```
## 距离查询
对拉伸体对象使用.sdf(Vec3 queryPoint)
```C++
Polyline axis{...};
ExtrudedSolidPolyline a{..., axis};
const Vec3 queryP = Vec3(...);
auto f = a.sdf(queryP);
```