57 #include "PolyLinePlugin.hh"
66 x = _circleData->circleMainAxis_;
67 z = _circleData->circleSideAxis_;
68 y = _circleData->circleNormal_;
72 x[0] * v[0] + y[0] * v[1] + z[0] * v[2],
73 x[1] * v[0] + y[1] * v[1] + z[1] * v[2],
74 x[2] * v[0] + y[2] * v[1] + z[2] * v[2]);
91 double smDist = 10e10;
93 for (
unsigned int j = 0; j < rayInt.
size(); j++) {
94 ACG::Vec3d p = _pOnPlane + _n * rayInt[j].second, dir = _center - p;
95 const double dist = dir.norm();
111 ACG::Vec3d n = _circleData->circleNormal_, x0 = _circleData->circleCenter_;
112 double t = ((n | x0) - (n | _hit_Point)) / n.sqrnorm();
113 ACG::Vec3d onPlane = _hit_Point + t * n, d = onPlane - x0;
117 *_onPlaneO = onPlane;
145 const double theta = 2.0 * M_PI / double(_pointCount);
147 const double r2 = lineData->circleMainRadius_, r1 = lineData->circleSideRadius_;
148 const Onb basis(lineData);
153 for (
unsigned int i = 0; i <= _pointCount; i++) {
154 const double tanTheta_i = tan(theta * i);
155 double x = (r1 * r2) / sqrt(r2 * r2 + r1 * r1 * tanTheta_i * tanTheta_i);
156 x = ((theta * i) <= M_PI_2 || (theta * i) > (3.0 * M_PI_2)) ? x : -x;
157 const double y = tanTheta_i * x;
160 pInWorld = basis.toWorld(pOnPlane) + lineData->circleCenter_;
161 if(moveCircle_IsFloating)
const UpdateType UPDATE_GEOMETRY(UpdateTypeSet(1)<< 2)
Geometry updated.
PerObjectData * objectData(QString _dataName)
Returns the object data pointer.
std::vector< std::pair< Handle, Scalar > > RayCollision
Store nearest neighbor information.
Type for a MeshObject containing a triangle mesh.
void updatePolyEllipse(PolyLineObject *_lineObject, unsigned int _pointCount)
Generates points for the ellipse.
bool getObject(int _identifier, BSplineCurveObject *&_object)
void clear()
Clear the current polyline.
OMTriangleBSP * requestTriangleBsp()
VectorT< double, 3 > Vec3d
bool createCircle_getHitInfo(PolyLineCircleData *_circleData, ACG::Vec3d _hit_Point, ACG::Vec3d *_pOut=0, double *_r=0, ACG::Vec3d *_onPlane=0)
Calculates common info.
RayCollision raycollision(const Point &_p, const Point &_r) const
intersect mesh with ray
bool createCircle_getPointOnMesh(TriMeshObject *_triMeshObject, ACG::Vec3d _center, ACG::Vec3d _pOnPlane, ACG::Vec3d _n, ACG::Vec3d *_pOut)
Calculates a point on the mesh.
void set_closed(const bool _c)
Set if the polyline should be closed and therefore forms a loop.
const UpdateType UPDATE_TOPOLOGY(UpdateTypeSet(1)<< 3)
Topology updated.
ACG::Vec3d createCircle_getHit(PolyLineCircleData *_circleData, ACG::Vec3d _hit_point)
Returns point on mesh or point on the normal plane.
void add_point(const Point &_p)
Append a point to the polyline.
PolyLineToolbarWidget * tool_
Widget for Toolbox.
PolyLine * line()
return a pointer to the line