#include <SpringbackCorrection.h>
Public Member Functions | |
bool | CalcCurv () |
calculates curvature-values as a distance-weighted convexcombination | |
std::vector< int > | FaceCheck (MeshCore::MeshKernel &mesh, int deg_tol) |
computes current angles of all triangles and stores the angle degrees in a vector | |
bool | FacetRegionGrowing (MeshCore::MeshKernel &mesh, std::vector< MeshCore::MeshFacet > &arr, MeshCore::MeshFacetArray &mFacets) |
performs a region-growing-algorithm | |
int | GetBoundary (const MeshCore::MeshKernel &mesh, MeshCore::MeshPointArray &meshPnts) |
returns index-value wich specifies the boundary-points of the input-mesh | |
bool | GetCurvature (TopoDS_Face aFace) |
computes maximum and minimum curvature-values of the specified input-face aFace | |
bool | Init () |
sets parameter-values to initial state, tesselates the input shape and computes a curvature-radius-value at each edge contained in the input-shape | |
bool | Init_Setting (struct CuttingToolsSettings &set) |
get external setting-parameters | |
std::vector< int > | InitFaceCheck (MeshCore::MeshKernel &mesh, int deg_tol) |
computes current angles of all triangles and sets the property value of the critical triangles to zero | |
bool | Load (const TopoDS_Shape &aShape, const MeshCore::MeshKernel &aMesh) |
loads input-shape and -mesh | |
bool | Load (const TopoDS_Shape &aShape) |
loads input-shape | |
bool | Load (const MeshCore::MeshKernel &aMesh) |
loads input-mesh | |
std::vector< double > | MeshCurvature (const TopoDS_Face &aFace, const MeshCore::MeshKernel &mesh) |
Computes mesh-based curvature-values at each mesh-point. | |
bool | Perform (int deg_Tol, bool out) |
main-function | |
std::vector< std::pair < unsigned long, double > > | RegionEvaluate (const MeshCore::MeshKernel &mesh, std::vector< unsigned long > &RegionFacets, std::vector< Base::Vector3f > &normals) |
computes offset-values for the inner-points of the specified region | |
bool | SetFixEdges () |
sets curvature-radius-value of user-specified edges to zero | |
bool | SmoothMesh (MeshCore::MeshKernel &mesh, std::vector< int > indicies, double maxTranslation) |
smooths specified mesh-points of the input-mesh | |
bool | SmoothMesh (MeshCore::MeshKernel &mesh, double maxTranslation) |
smooths input-mesh | |
SpringbackCorrection (const TopoDS_Shape &aShape, const MeshCore::MeshKernel &aMesh) | |
Constructor. | |
SpringbackCorrection () | |
Constructor. | |
bool | TransferFaceTriangulationtoFreeCAD (const TopoDS_Face &aFace, MeshCore::MeshKernel &TFaceMesh) |
builds a mesh-kernel out of one face-triangulation | |
bool | Visit (const MeshCore::MeshFacet &rclFacet, const MeshCore::MeshFacet &rclFrom, unsigned long ulFInd, unsigned long ulLevel) |
checks the visit-state of specified triangle | |
~SpringbackCorrection () | |
Constructor. | |
Public Attributes | |
std::map< TopoDS_Edge, std::vector< double > , Edge_Less > | EdgeMap |
map over all edges | |
MeshCore::MeshKernel | m_CadMesh |
triangulation of the CAD-shape | |
std::vector< Base::Vector3f > | m_dist_vec |
vector containing translation-vectors at all mesh-points | |
std::vector< TopoDS_Face > | m_FixFaces |
vector containing the user-specified faces wich stands fix during the springback-correction | |
MeshCore::MeshKernel | m_Mesh |
input-mesh | |
MeshCore::MeshKernel | m_Mesh_vis |
mesh containing the movable regions for the local translation | |
MeshCore::MeshKernel | m_Mesh_vis2 |
mesh containing the fix regions for the local translation | |
std::map< Base::Vector3f, MeshPnt, MeshPntLess > | MeshMap |
map wich links mesh-point to mesh-index |
Definition at line 134 of file SpringbackCorrection.h.
SpringbackCorrection::SpringbackCorrection | ( | ) |
Constructor.
Definition at line 64 of file SpringbackCorrection.cpp.
SpringbackCorrection::SpringbackCorrection | ( | const TopoDS_Shape & | aShape, | |
const MeshCore::MeshKernel & | aMesh | |||
) |
Constructor.
aShape | input-shape (CAD-Model) | |
aMesh | input-mesh |
Definition at line 68 of file SpringbackCorrection.cpp.
References MeshCore::MeshKernel::Assign(), MeshCore::MeshKernel::CountFacets(), EdgeMap, MeshCore::MeshTopoAlgorithm::FlipNormals(), MeshCore::MeshKernel::GetFacet(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshGeomFacet::GetNormal(), MeshCore::MeshKernel::GetPoints(), MeshCore::MeshTopoAlgorithm::HarmonizeNormals(), m_CadMesh, MeshMap, best_fit::Tesselate_Shape(), and Base::Vector3< _Precision >::z.
SpringbackCorrection::~SpringbackCorrection | ( | ) |
Constructor.
Definition at line 106 of file SpringbackCorrection.cpp.
bool SpringbackCorrection::CalcCurv | ( | ) |
calculates curvature-values as a distance-weighted convexcombination
Definition at line 164 of file SpringbackCorrection.cpp.
References Base::Builder3D::addSingleArrow(), Base::Builder3D::addSinglePoint(), Base::Builder3D::addText(), MeshCore::MeshKernel::Assign(), MeshCore::MeshKernel::CountPoints(), draftlibs::fcvec::dist(), EdgeMap, GetBoundary(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), Handle(), UnitParser::if(), MeshPnt::index, k, RobotExample::l, KDL::log(), m_CadMesh, m_dist_vec, m_FixFaces, MeshPnt::maxCurv, MeshMap, MeshPnt::minCurv, MeshPnt::pnt, Base::Builder3D::saveToFile(), Set(), Base::Vector3< _Precision >::Set(), TransferFaceTriangulationtoFreeCAD(), RobotExample::w, MovieTool::x, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by Perform().
std::vector< int > SpringbackCorrection::FaceCheck | ( | MeshCore::MeshKernel & | mesh, | |
int | deg_tol | |||
) |
computes current angles of all triangles and stores the angle degrees in a vector
mesh | input-mesh | |
deg_tol | limiting forming-angle computes current angles of all triangles and stores the critical-triangle-indicies in a vector | |
mesh | input-mesh | |
deg_tol | limiting forming-angle |
Definition at line 1163 of file SpringbackCorrection.cpp.
References KDL::acos(), Base::Builder3D::addSingleArrow(), MeshCore::MeshGeomFacet::CalcNormal(), MeshCore::MeshKernel::CountFacets(), MeshCore::MeshKernel::GetFacet(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshGeomFacet::GetGravityPoint(), MeshCore::MeshGeomFacet::GetNormal(), MeshCore::MeshKernel::GetPoints(), KDL::log(), Base::Vector3< _Precision >::Normalize(), KDL::PI, Base::Builder3D::saveToFile(), and Base::Vector3< _Precision >::z.
Referenced by Perform().
bool SpringbackCorrection::FacetRegionGrowing | ( | MeshCore::MeshKernel & | mesh, | |
std::vector< MeshCore::MeshFacet > & | arr, | |||
MeshCore::MeshFacetArray & | mFacets | |||
) |
performs a region-growing-algorithm
Definition at line 1794 of file SpringbackCorrection.cpp.
References MeshCore::MeshFacet::_ulProp, MeshCore::MeshKernel::GetFacets(), MeshCore::MeshFacet::INVALID, MeshCore::MeshFacetArray::SetFlag(), and MeshCore::MeshFacet::VISIT.
int SpringbackCorrection::GetBoundary | ( | const MeshCore::MeshKernel & | mesh, | |
MeshCore::MeshPointArray & | meshPnts | |||
) |
returns index-value wich specifies the boundary-points of the input-mesh
mesh | input-mesh | |
meshPnts | mesh-points of input-mesh |
Definition at line 774 of file SpringbackCorrection.cpp.
References MeshCore::MeshAlgorithm::GetMeshBorders(), and MeshCore::MeshPointArray::SetProperty().
Referenced by CalcCurv().
bool SpringbackCorrection::GetCurvature | ( | TopoDS_Face | aFace | ) |
computes maximum and minimum curvature-values of the specified input-face aFace
aFace | input-face |
Definition at line 1853 of file SpringbackCorrection.cpp.
References Py::abs(), Base::Builder3D::addSingleLine(), MeshCore::MeshPointIterator::Begin(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), KDL::log(), m_Mesh, MeshCore::MeshPointIterator::More(), MeshCore::MeshPointIterator::Next(), MeshCore::MeshPointIterator::Position(), Base::Vector3< _Precision >::x, MovieTool::x, Base::Vector3< _Precision >::y, MovieTool::y, and Base::Vector3< _Precision >::z.
bool SpringbackCorrection::Init | ( | void | ) |
sets parameter-values to initial state, tesselates the input shape and computes a curvature-radius-value at each edge contained in the input-shape
Definition at line 558 of file SpringbackCorrection.cpp.
References EdgeStruct::aFace, EdgeStruct::anEdge, MeshCore::MeshKernel::Assign(), cMin, MeshCore::MeshKernel::CountFacets(), EdgeMap, MeshCore::MeshTopoAlgorithm::FlipNormals(), MeshCore::MeshKernel::GetFacet(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshGeomFacet::GetNormal(), MeshCore::MeshKernel::GetPoints(), MeshCore::MeshTopoAlgorithm::HarmonizeNormals(), m_CadMesh, KDL::max(), EdgeStruct::MaxOffset, MeshCurvature(), MeshMap, EdgeStruct::MinOffset, best_fit::Tesselate_Shape(), TransferFaceTriangulationtoFreeCAD(), and Base::Vector3< _Precision >::z.
Referenced by CamGui::Cutting::on_best_fit_go_button_clicked().
bool SpringbackCorrection::Init_Setting | ( | struct CuttingToolsSettings & | set | ) |
get external setting-parameters
Definition at line 663 of file SpringbackCorrection.cpp.
Referenced by CamGui::Cutting::on_best_fit_go_button_clicked().
std::vector< int > SpringbackCorrection::InitFaceCheck | ( | MeshCore::MeshKernel & | mesh, | |
int | deg_tol | |||
) |
computes current angles of all triangles and sets the property value of the critical triangles to zero
mesh | input-mesh | |
deg_tol | limiting forming-angle |
Definition at line 1079 of file SpringbackCorrection.cpp.
References KDL::acos(), Base::Builder3D::addSingleArrow(), MeshCore::MeshKernel::Assign(), MeshCore::MeshKernel::CountFacets(), MeshCore::MeshKernel::GetFacet(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshGeomFacet::GetGravityPoint(), MeshCore::MeshGeomFacet::GetNormal(), MeshCore::MeshKernel::GetPoints(), KDL::log(), Base::Vector3< _Precision >::Normalize(), KDL::PI, Base::Builder3D::saveToFile(), MeshCore::MeshFacetArray::SetProperty(), and Base::Vector3< _Precision >::z.
Referenced by Perform().
bool SpringbackCorrection::Load | ( | const TopoDS_Shape & | aShape, | |
const MeshCore::MeshKernel & | aMesh | |||
) |
loads input-shape and -mesh
Definition at line 122 of file SpringbackCorrection.cpp.
References MeshCore::MeshKernel::CountFacets(), EdgeMap, MeshCore::MeshTopoAlgorithm::FlipNormals(), MeshCore::MeshKernel::GetFacet(), MeshCore::MeshGeomFacet::GetNormal(), MeshCore::MeshTopoAlgorithm::HarmonizeNormals(), m_CadMesh, m_Mesh, MeshMap, best_fit::Tesselate_Shape(), and Base::Vector3< _Precision >::z.
bool SpringbackCorrection::Load | ( | const TopoDS_Shape & | aShape | ) |
loads input-shape
Definition at line 117 of file SpringbackCorrection.cpp.
bool SpringbackCorrection::Load | ( | const MeshCore::MeshKernel & | aMesh | ) |
loads input-mesh
Definition at line 109 of file SpringbackCorrection.cpp.
Referenced by CamGui::Cutting::on_best_fit_go_button_clicked(), CamGui::Cutting::on_best_fit_mesh2_button_clicked(), and CamGui::Cutting::on_best_fit_mesh_button_clicked().
std::vector< double > SpringbackCorrection::MeshCurvature | ( | const TopoDS_Face & | aFace, | |
const MeshCore::MeshKernel & | mesh | |||
) |
Computes mesh-based curvature-values at each mesh-point.
aFace | ||
mesh | input-mesh |
Definition at line 1978 of file SpringbackCorrection.cpp.
References Mod::PartDesign::Scripts::Gear::c1, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshKernel::CountPoints(), MeshCore::MeshKernel::GetFacets(), Wm4::MeshCurvature< Real >::GetMaxCurvatures(), Wm4::MeshCurvature< Real >::GetMaxDirections(), Wm4::MeshCurvature< Real >::GetMinCurvatures(), Wm4::MeshCurvature< Real >::GetMinDirections(), MeshCore::MeshPointIterator::Init(), MeshCore::MeshPointIterator::More(), MeshCore::MeshPointIterator::Next(), and KDL::sqrt().
Referenced by Init().
bool SpringbackCorrection::Perform | ( | int | deg_Tol, | |
bool | out | |||
) |
main-function
deg_Tol | limiting forming-angle | |
out |
Definition at line 1230 of file SpringbackCorrection.cpp.
References MeshCore::MeshBuilder::AddFacet(), Base::Builder3D::addSingleArrow(), Base::Builder3D::addSinglePoint(), MeshCore::MeshKernel::Assign(), CalcCurv(), best_fit::CompTotalError(), CuttingToolsSettings::correction_factor, MeshCore::MeshKernel::CountPoints(), draftlibs::dxfReader::error(), FaceCheck(), MeshCore::MeshBuilder::Finish(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), InitFaceCheck(), MeshCore::MeshBuilder::Initialize(), Py::int, k, RobotExample::l, Base::Length, FemExample::m, best_fit::m_CadMesh, m_CadMesh, m_dist_vec, best_fit::m_error, m_Mesh_vis, m_Mesh_vis2, best_fit::m_normals, CuttingToolsSettings::master_radius, RegionEvaluate(), Base::Builder3D::saveToFile(), SetFixEdges(), MeshCore::MeshFacetArray::SetFlag(), CuttingToolsSettings::slave_radius, MeshCore::MeshFacet::VISIT, MeshCore::MeshKernel::VisitNeighbourFacets(), MovieTool::x, and MovieTool::y.
Referenced by CamGui::Cutting::on_best_fit_go_button_clicked(), and spring_back().
std::vector< std::pair< unsigned long, double > > SpringbackCorrection::RegionEvaluate | ( | const MeshCore::MeshKernel & | mesh, | |
std::vector< unsigned long > & | RegionFacets, | |||
std::vector< Base::Vector3f > & | normals | |||
) |
computes offset-values for the inner-points of the specified region
Definition at line 1712 of file SpringbackCorrection.cpp.
References KDL::cos(), MeshCore::MeshAlgorithm::GetFacetBorders(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), Base::Vector3< _Precision >::Length(), and KDL::PI.
Referenced by Perform().
bool SpringbackCorrection::SetFixEdges | ( | ) |
sets curvature-radius-value of user-specified edges to zero
Definition at line 669 of file SpringbackCorrection.cpp.
References EdgeMap, and m_FixFaces.
Referenced by Perform().
bool SpringbackCorrection::SmoothMesh | ( | MeshCore::MeshKernel & | mesh, | |
std::vector< int > | indicies, | |||
double | maxTranslation | |||
) |
smooths specified mesh-points of the input-mesh
mesh | input-mesh | |
indicies | vector of indicies of the mesh-points for smoothing | |
maxTranslation | value wich stands for the maximum deviation from the initial-mesh |
Definition at line 948 of file SpringbackCorrection.cpp.
References MeshCore::MeshGeomFacet::_aclPoints, MeshCore::MeshKernel::AddFacet(), Base::Builder3D::addSingleArrow(), Base::Builder3D::addSinglePoint(), MeshCore::MeshKernel::Assign(), MeshCore::MeshEigensystem::Evaluate(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), KDL::log(), Base::Vector3< _Precision >::Normalize(), MeshCore::MeshPointIterator::Position(), Base::Builder3D::saveToFile(), Base::Vector3< _Precision >::Scale(), Base::Vector3< _Precision >::Set(), MeshCore::MeshPointIterator::Set(), MeshCore::MeshEigensystem::Transform(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
bool SpringbackCorrection::SmoothMesh | ( | MeshCore::MeshKernel & | mesh, | |
double | maxTranslation | |||
) |
smooths input-mesh
mesh | input-mesh | |
maxTranslation | value wich stands for the maximum deviation from the initial-mesh |
Definition at line 849 of file SpringbackCorrection.cpp.
References MeshCore::MeshGeomFacet::_aclPoints, MeshCore::MeshKernel::AddFacet(), Base::Builder3D::addSingleArrow(), Base::Builder3D::addSinglePoint(), MeshCore::MeshKernel::Assign(), MeshCore::MeshPointIterator::Begin(), MeshCore::MeshEigensystem::Evaluate(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), KDL::log(), MeshCore::MeshPointIterator::More(), MeshCore::MeshPointIterator::Next(), Base::Vector3< _Precision >::Normalize(), MeshCore::MeshPointIterator::Position(), Base::Builder3D::saveToFile(), Base::Vector3< _Precision >::Scale(), Base::Vector3< _Precision >::Set(), MeshCore::MeshEigensystem::Transform(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
bool SpringbackCorrection::TransferFaceTriangulationtoFreeCAD | ( | const TopoDS_Face & | aFace, | |
MeshCore::MeshKernel & | TFaceMesh | |||
) |
builds a mesh-kernel out of one face-triangulation
aFace | face of concern | |
TFaceMesh | MeshKernel where the triangulation will be stored |
Definition at line 689 of file SpringbackCorrection.cpp.
References MeshCore::MeshBuilder::AddFacet(), MeshCore::MeshKernel::Clear(), MeshCore::MeshBuilder::Finish(), MeshCore::MeshBuilder::Initialize(), and Base::Vector3< _Precision >::Set().
Referenced by CalcCurv(), Deviation::GenNormals(), and Init().
bool SpringbackCorrection::Visit | ( | const MeshCore::MeshFacet & | rclFacet, | |
const MeshCore::MeshFacet & | rclFrom, | |||
unsigned long | ulFInd, | |||
unsigned long | ulLevel | |||
) | [virtual] |
checks the visit-state of specified triangle
Implements MeshCore::MeshFacetVisitor.
Definition at line 3071 of file SpringbackCorrection.cpp.
References MeshCore::MeshFacet::_ulProp.
std::map<TopoDS_Edge, std::vector<double>, Edge_Less> SpringbackCorrection::EdgeMap |
map over all edges
Definition at line 334 of file SpringbackCorrection.h.
Referenced by CalcCurv(), Init(), Load(), SetFixEdges(), and SpringbackCorrection().
triangulation of the CAD-shape
Definition at line 277 of file SpringbackCorrection.h.
Referenced by CalcCurv(), Init(), Load(), CamGui::Cutting::on_best_fit_go_button_clicked(), Perform(), and SpringbackCorrection().
std::vector<Base::Vector3f> SpringbackCorrection::m_dist_vec |
vector containing translation-vectors at all mesh-points
Definition at line 279 of file SpringbackCorrection.h.
Referenced by CalcCurv(), and Perform().
std::vector<TopoDS_Face> SpringbackCorrection::m_FixFaces |
vector containing the user-specified faces wich stands fix during the springback-correction
Definition at line 338 of file SpringbackCorrection.h.
Referenced by CalcCurv(), CamGui::Cutting::setFace(), and SetFixEdges().
input-mesh
Reimplemented in Deviation.
Definition at line 270 of file SpringbackCorrection.h.
Referenced by GetCurvature(), and Load().
mesh containing the movable regions for the local translation
Definition at line 273 of file SpringbackCorrection.h.
Referenced by CamGui::Cutting::on_best_fit_go_button_clicked(), and Perform().
mesh containing the fix regions for the local translation
Definition at line 275 of file SpringbackCorrection.h.
Referenced by CamGui::Cutting::on_best_fit_go_button_clicked(), and Perform().
map wich links mesh-point to mesh-index
Definition at line 332 of file SpringbackCorrection.h.
Referenced by CalcCurv(), Deviation::GenNormals(), Init(), Load(), and SpringbackCorrection().