|
OOFEM 3.0
|
#include <algorithm>#include <memory>#include <math.h>#include <vector>#include <deque>#include <map>#include <assert.h>Go to the source code of this file.
Classes | |
| struct | Vector |
| struct | Vertex |
| struct | Plane |
| struct | Polygon |
| struct | Model |
| struct | CSGNode |
Typedefs | |
| typedef CSGNode * | csg_function(const CSGNode *a1, const CSGNode *b1) |
| using | Tag = size_t |
| using | SideTag = std::pair<Tag, Tag> |
Functions | |
| bool | approxequal (double a, double b) |
| bool | operator== (const Vector &a, const Vector &b) |
| bool | operator!= (const Vector &a, const Vector &b) |
| Vector | operator+ (const Vector &a, const Vector &b) |
| Vector | operator- (const Vector &a, const Vector &b) |
| Vector | operator* (const Vector &a, double b) |
| Vector | operator/ (const Vector &a, double b) |
| double | dot (const Vector &a, const Vector &b) |
| Vector | lerp (const Vector &a, const Vector &b, double v) |
| Vector | negate (const Vector &a) |
| double | length (const Vector &a) |
| double | lengthsquared (const Vector &a) |
| Vector | unit (const Vector &a) |
| Vector | cross (const Vector &a, const Vector &b) |
| Vector | operator- (const Vector &a) |
| int | lerp (int a, int b, double v) |
| bool | operator== (const Vertex &a, const Vertex &b) |
| bool | operator!= (const Vertex &a, const Vertex &b) |
| double | interpolate_between (const Vertex &a, const Vertex &b, const Vertex &v) |
| double | distanceToLine (const Vector &point, const Vector &linePoint1, const Vector &linePoint2) |
| void | addMissingVertices (Model &mesh) |
| void | writeSTL (const Model &model, std::string filename) |
| void | writeModelsSTL (const std::vector< Model > &models, std::string filename) |
| Model | csgunion (const Model &a, const Model &b) |
| Model | csgintersection (const Model &a, const Model &b) |
| Model | csgsubtract (const Model &a, const Model &b) |
| std::vector< Polygon > | csgunion (const std::vector< Polygon > &a, const std::vector< Polygon > &b) |
| std::vector< Polygon > | csgintersection (const std::vector< Polygon > &a, const std::vector< Polygon > &b) |
| std::vector< Polygon > | csgsubtract (const std::vector< Polygon > &a, const std::vector< Polygon > &b) |
| std::vector< Polygon > | csgpolygon_cube (const Vector ¢er={ 0.0, 0.0, 0.0 }, const Vector &dim={ 1.0, 1.0, 1.0 }, const int col=0xFFFFFF) |
| std::vector< Polygon > | csgpolygon_sphere (const Vector ¢er={ 0.0, 0.0, 0.0 }, double radius=1.0, const int col=0xFFFFFF, int slices=16, int stacks=8) |
| std::vector< Polygon > | csgpolygon_cylinder (const Vector &s={ 0.0, -1.0, 0.0 }, const Vector &e={ 0.0, 1.0, 0.0 }, double radius=1.0, const int col=0xFFFFFF, int slices=16) |
| std::vector< Polygon > | csgfixtjunc (const std::vector< Polygon > &polygons) |
| Model | modelfrompolygons (const std::vector< Polygon > &polygons) |
| Model | csgmodel_cube (const Vector ¢er={ 0.0, 0.0, 0.0 }, const Vector &dim={ 1.0, 1.0, 1.0 }, const int col=0xFFFFFF) |
| Model | csgmodel_sphere (const Vector ¢er={ 0.0, 0.0, 0.0 }, double radius=1.0, const int col=0xFFFFFF, int slices=16, int stacks=8) |
| Model | csgmodel_cylinder (const Vector &s={ 0.0, -1.0, 0.0 }, const Vector &e={ 0.0, 1.0, 0.0 }, double radius=1.0, const int col=0xFFFFFF, int slices=16) |
| Vertex | flip (Vertex v) |
| Vertex | interpolate (const Vertex &a, const Vertex &b, double t) |
| CSGNode * | csg_union (const CSGNode *a1, const CSGNode *b1) |
| CSGNode * | csg_subtract (const CSGNode *a1, const CSGNode *b1) |
| CSGNode * | csg_intersect (const CSGNode *a1, const CSGNode *b1) |
| std::vector< Polygon > | modeltopolygons (const Model &model) |
| std::vector< Polygon > | csgjs_operation (const std::vector< Polygon > &apoly, const std::vector< Polygon > &bpoly, csg_function fun) |
| std::vector< Polygon > | csgjs_operation (const Model &a, const Model &b, csg_function fun) |
| template<class CONTTYPE, class T> | |
| bool | contains (CONTTYPE &cont, const T &t) |
| template<class CONTTYPE, class T> | |
| CONTTYPE::iterator | find (CONTTYPE &cont, const T &t) |
| template<class T, typename... Ks> | |
| std::map< Ks... >::iterator | find (std::map< Ks... > &cont, const T &t) |
| template<typename T> | |
| std::vector< T >::iterator | find (std::vector< T > &cont, const T &t) |
| template<typename T> | |
| void | remove (std::vector< T > &cont, const T &t) |
| template<typename T, typename... Ks> | |
| void | remove (std::map< Ks... > &cont, const T &t) |
| bool | operator== (const SideTag &a, const SideTag &b) |
Variables | |
| const double | csgjs_EPSILON = 0.0001 |
| const int | kInvalidPolygonIndex = -1 |
| void addMissingVertices | ( | Model & | mesh | ) |
Definition at line 270 of file CSG.h.
References approxequal(), cross(), distanceToLine(), Model::indices, interpolate_between(), Vertex::pos, unit(), Model::vertices, Vector::x, Vector::y, and Vector::z.
|
inline |
Definition at line 43 of file CSG.h.
References csgjs_EPSILON.
Referenced by addMissingVertices(), operator!=(), and operator==().
| bool contains | ( | CONTTYPE & | cont, |
| const T & | t ) |
Definition at line 1107 of file CSG.h.
Referenced by oofem::AABB::contains(), csgfixtjunc(), oofem::ContactSearchAlgorithm_Surface2FESurface_3d_SweepAndPrune::initialize(), and oofem::ContactSearchAlgorithm_Surface2FESurface_3d_SweepAndPrune::solveInversion().
Definition at line 102 of file CSG.h.
References Vector::x, Vector::y, and Vector::z.
Referenced by addMissingVertices(), csgpolygon_cylinder(), Plane::Plane(), Model::volume(), writeModelsSTL(), and writeSTL().
Definition at line 691 of file CSG.h.
References CSGNode::allpolygons(), CSGNode::build(), CSGNode::clipto(), CSGNode::clone(), and CSGNode::invert().
Referenced by csgintersection(), and csgintersection().
Definition at line 671 of file CSG.h.
References CSGNode::allpolygons(), CSGNode::build(), CSGNode::clipto(), CSGNode::clone(), and CSGNode::invert().
Referenced by csgsubtract(), and csgsubtract().
Definition at line 653 of file CSG.h.
References CSGNode::allpolygons(), CSGNode::build(), CSGNode::clipto(), CSGNode::clone(), and CSGNode::invert().
Referenced by csgunion(), and csgunion().
Definition at line 1169 of file CSG.h.
References contains(), dot(), find(), kInvalidPolygonIndex, lengthsquared(), Polygon::plane, remove(), and Polygon::vertices.
Definition at line 1081 of file CSG.h.
References csg_intersect(), csgjs_operation(), and modelfrompolygons().
Referenced by Printer::handleG1Command().
| std::vector< Polygon > csgintersection | ( | const std::vector< Polygon > & | a, |
| const std::vector< Polygon > & | b ) |
Definition at line 1096 of file CSG.h.
References csg_intersect(), and csgjs_operation().
|
inline |
Definition at line 965 of file CSG.h.
References csgjs_operation(), and modeltopolygons().
| std::vector< Polygon > csgjs_operation | ( | const std::vector< Polygon > & | apoly, |
| const std::vector< Polygon > & | bpoly, | ||
| csg_function | fun ) |
Definition at line 953 of file CSG.h.
Referenced by csgintersection(), csgintersection(), csgjs_operation(), csgsubtract(), csgsubtract(), csgunion(), and csgunion().
| Model csgmodel_cube | ( | const Vector & | center = { 0.0, 0.0, 0.0 }, |
| const Vector & | dim = { 1.0, 1.0, 1.0 }, | ||
| const int | col = 0xFFFFFF ) |
Definition at line 993 of file CSG.h.
References csgpolygon_cube(), and modelfrompolygons().
| Model csgmodel_cylinder | ( | const Vector & | s = { 0.0, -1.0, 0.0 }, |
| const Vector & | e = { 0.0, 1.0, 0.0 }, | ||
| double | radius = 1.0, | ||
| const int | col = 0xFFFFFF, | ||
| int | slices = 16 ) |
Definition at line 1070 of file CSG.h.
References csgpolygon_cylinder(), and modelfrompolygons().
| Model csgmodel_sphere | ( | const Vector & | center = { 0.0, 0.0, 0.0 }, |
| double | radius = 1.0, | ||
| const int | col = 0xFFFFFF, | ||
| int | slices = 16, | ||
| int | stacks = 8 ) |
Definition at line 1030 of file CSG.h.
References csgpolygon_sphere(), and modelfrompolygons().
Definition at line 1086 of file CSG.h.
References csg_subtract(), csgjs_operation(), and modelfrompolygons().
| std::vector< Polygon > csgsubtract | ( | const std::vector< Polygon > & | a, |
| const std::vector< Polygon > & | b ) |
Definition at line 1101 of file CSG.h.
References csg_subtract(), and csgjs_operation().
Definition at line 1076 of file CSG.h.
References csg_union(), csgjs_operation(), and modelfrompolygons().
| std::vector< Polygon > csgunion | ( | const std::vector< Polygon > & | a, |
| const std::vector< Polygon > & | b ) |
Definition at line 1091 of file CSG.h.
References csg_union(), and csgjs_operation().
Definition at line 76 of file CSG.h.
References Vector::x, Vector::y, and Vector::z.
Referenced by Plane::classify(), csgfixtjunc(), interpolate_between(), length(), lengthsquared(), Plane::Plane(), Plane::splitpolygon(), and Model::volume().
| CONTTYPE::iterator find | ( | CONTTYPE & | cont, |
| const T & | t ) |
Referenced by csgfixtjunc(), and remove().
| std::map< Ks... >::iterator find | ( | std::map< Ks... > & | cont, |
| const T & | t ) |
| std::vector< T >::iterator find | ( | std::vector< T > & | cont, |
| const T & | t ) |
Definition at line 540 of file CSG.h.
References negate(), and Vertex::normal.
Definition at line 549 of file CSG.h.
References Vertex::col, lerp(), Vertex::normal, and Vertex::pos.
Referenced by Plane::splitpolygon().
Definition at line 134 of file CSG.h.
References dot(), lengthsquared(), and Vertex::pos.
Referenced by addMissingVertices().
|
inline |
Definition at line 88 of file CSG.h.
References dot().
Referenced by oofem::TR1_2D_SUPG2::computeBCRhsTerm_MB(), oofem::LatticeDamage::computeDeltaDissipation2d(), oofem::LatticeDamage::computeDeltaDissipation3d(), oofem::Lattice3d_mt::computeGeometryProperties(), oofem::CCTPlate::computeLoadLEToLRotationMatrix(), oofem::DKTPlate3d::computeLoadLEToLRotationMatrix(), oofem::DKTPlate::computeLoadLEToLRotationMatrix(), oofem::QDKTPlate::computeLoadLEToLRotationMatrix(), oofem::Quad1Mindlin::computeLoadLEToLRotationMatrix(), oofem::Quad1MindlinShell3D::computeLoadLEToLRotationMatrix(), oofem::NonlocalMaterialExtensionInterface::computeModifiedLength(), oofem::LinearEdgeLoad::computeNArray(), oofem::LSpace::drawSpecial(), oofem::LTRSpace::drawSpecial(), oofem::PlaneStress2d::drawSpecial(), oofem::Quad1PlaneStrain::drawSpecial(), oofem::TrPlaneStress2d::drawSpecial(), oofem::LIBeam3dNL2::giveLocalCoordinateSystem(), oofem::LIBeam3dNL::giveLocalCoordinateSystem(), oofem::LatticeLinearElastic::giveThermalDilatationVector(), oofem::LatticeSlip::giveThermalDilatationVector(), oofem::FRCFCM::initializeFrom(), Plane::ok(), oofem::LatticeDamage::performDamageEvaluation(), oofem::MPSDamMaterialStatus::setCharLength(), unit(), and oofem::FreeWarping::updateComputedResults().
|
inline |
Definition at line 93 of file CSG.h.
References dot().
Referenced by csgfixtjunc(), and interpolate_between().
Definition at line 80 of file CSG.h.
Referenced by interpolate().
Definition at line 924 of file CSG.h.
References Model::AddVertex(), Model::indices, and Polygon::vertices.
Referenced by csgintersection(), csgmodel_cube(), csgmodel_cylinder(), csgmodel_sphere(), csgsubtract(), csgunion(), Printer::get_model(), and VoxelGrid::get_model().
Definition at line 910 of file CSG.h.
References Model::indices, and Model::vertices.
Referenced by csgjs_operation().
Definition at line 84 of file CSG.h.
Referenced by flip(), Plane::flip(), and Polygon::flip().
Definition at line 128 of file CSG.h.
References Vertex::col, Vertex::normal, and Vertex::pos.
Definition at line 123 of file CSG.h.
References Vertex::col, Vertex::normal, and Vertex::pos.
| void remove | ( | std::map< Ks... > & | cont, |
| const T & | t ) |
| void remove | ( | std::vector< T > & | cont, |
| const T & | t ) |
Definition at line 1122 of file CSG.h.
References find().
Referenced by csgfixtjunc(), and oofem::Graph::merge2vertex().
Definition at line 98 of file CSG.h.
References length().
Referenced by addMissingVertices(), csgpolygon_cylinder(), Plane::Plane(), writeModelsSTL(), and writeSTL().
| void writeModelsSTL | ( | const std::vector< Model > & | models, |
| std::string | filename ) |
| void writeSTL | ( | const Model & | model, |
| std::string | filename ) |
Definition at line 429 of file CSG.h.
References cross(), Model::indices, Vertex::pos, unit(), Model::vertices, Vector::x, Vector::y, and Vector::z.
| const double csgjs_EPSILON = 0.0001 |
Definition at line 28 of file CSG.h.
Referenced by approxequal(), and Plane::classify().
| const int kInvalidPolygonIndex = -1 |
Definition at line 1139 of file CSG.h.
Referenced by csgfixtjunc().