33 #ifndef __H__UG__remeshing_tools__
34 #define __H__UG__remeshing_tools__
57 #define TOOLTIP_SIMPLIFY_POLYLINES "Removes vertices from the selected polyline which have a smaller curvature than the specified angle."
58 #define TOOLTIP_SIMPLIFY_SMOOTHED_POLYLINES "Removes vertices from the selected polyline which have a smaller smoothed curvature than the specified angle."
59 #define TOOLTIP_CONVERT_TO_TRIANGLES "Converts selected quadrilaterals to triangles."
60 #define TOOLTIP_CONVERT_TO_QUADRILATERALS "Converts selected triangles or triangles connected by selected edges to quadrilaterals."
61 #define TOOLTIP_TRIANGLE_FILL "Performs triangle fill using the sweep-line algorithm followed by an optional Constrained Delaunay retriangulation."
62 #define TOOLTIP_RETRIANGULATE "Inserts vertices as required and performs Constrained Delaunay triangulation."
63 #define TOOLTIP_ADJUST_EDGE_LENGTH "Remeshes the active grid so that all edges approximatly have a certain length."
64 #define TOOLTIP_ADAPT_SURFACE_TO_CYLINDER "Introduces edges in a grid around a selected vertex which roughly correspond to the intersection of a cylinder with the surface."
65 #define TOOLTIP_REPLACE_VALENCE_3_VERTICES "Replaces selected valence-3 vertices by triangles, if the curvature of associated triangles is low"
66 #define TOOLTIP_REPLACE_LOW_VALENCE_VERTICES "Replaces selected valence-3 and valence-4 vertices by triangles, if the curvature of associated triangles is low"
67 #define TOOLTIP_CONVERT_TO_TETRAHEDRA "Converts selected volume elements to tetrahedra."
68 #define TOOLTIP_TETRAHEDRALIZE "Fills a closed surface with tetrahedra using TetGen."
69 #define TOOLTIP_ASSIGN_VOLUME_CONSTRAINTS "Assigns volume constraints to selected tetrahedra."
70 #define TOOLTIP_CLEAR_VOLUME_CONSTRAINTS "Clears all assigned volume constraints."
71 #define TOOLTIP_RETETRAHEDRALIZE "Given a tetrahedralization and volume constraints, this method adapts the tetrahedra using TetGen."
72 #define TOOLTIP_DUPLICATE "Duplicates the selected geometry."
73 #define TOOLTIP_EXTRUDE_AND_MOVE "Extrudes selected geometry (vertices, edges, faces) and moves new vertices by the specified offset."
74 #define TOOLTIP_EXTRUDE_AND_SCALE "Extrudes selected geometry (vertices, edges, faces) and scales new vertices by the specified scale."
75 #define TOOLTIP_EXTRUDE_ALONG_NORMAL "Extrudes selected geometry (vertices, edges, faces) and moves new vertices along their normal."
76 #define TOOLTIP_EXTRUDE_TO_TICKNESS "Extrudes selected geometry (vertices, edges, faces) and moves new vertices so that created elements have the specified thickness."
77 #define TOOLTIP_EXTRUDE_CYLINDERS "Extrudes cylinders around selected points of a 2d manifold."
78 #define TOOLTIP_CREATE_SHRINK_GEOMETRY "Creates new elements from existing ones, providing each with a unique set of corner vertices. Those corners are scaled towards the center using the given scale-parameter."
79 #define TOOLTIP_EXTRUDE_FACES_WITH_TETS "Experimental function to create 'plaque'-like geometry based on extruding faces with tetrahedra."
81 #define TOOLTIP_MESH_LAYERS "Creates triangle/quadrilateral grids for the given raster-layers"
82 #define TOOLTIP_MESH_LAYER_BOUNDARIES "Creates boundary grids for the given raster-layers"
83 #define TOOLTIP_PROJECT_TO_LAYER "Projects a (surface-)mesh to the specified raster-layer. Only height values in valid regions are adjusted."
84 #define TOOLTIP_PROJECT_TO_TOP_LAYER "Projects a (surface-)mesh to the top-layer of the specified raster-stack. Only height values in valid regions are adjusted."
85 #define TOOLTIP_EXTRUDE_LAYERS "Creates volumes for a given stack of raster-layers and an initial triangulation of the surface."
86 #define TOOLTIP_EXTRUDE_LAYERS_AND_ADD_PROJECTOR "Creates volumes for a given stack of raster-layers and an initial triangulation of the surface. It also generates a raster-based refinement-projector for the whole geometry."
87 #define TOOLTIP_SNAP_TO_HORIZONTAL_RASTER "Snaps all vertices of the given (surface) grid horizontally to the closest raster-node."
89 #define TOOLTIP_CSG_FACE_UNION "Performs a union operation on the geometry of the two specifed subsets. IMPORTANT: Both subsets have to be closed manifolds, i.e., homeomorphic to the sphere."
90 #define TOOLTIP_CSG_FACE_INTERSECTION "Performs an intersection operation on the geometry of the two specifed subsets. IMPORTANT: Both subsets have to be closed manifolds, i.e., homeomorphic to the sphere."
91 #define TOOLTIP_CSG_FACE_DIFFERENCE "Performs a difference operation on the geometry of the two specifed subsets. IMPORTANT: Both subsets have to be closed manifolds, i.e., homeomorphic to the sphere."
103 number curvatureThreshold,
105 int smoothingIterations);
123 bool automarkBoundaries);
132 bool automarkBoundaries);
143 bool separateVolumes,
144 bool appendSubsetsAtEnd,
156 bool applyVolumeConstraint,
159 void Duplicate(Mesh* obj,
const vector3& offset,
bool deselectOld,
bool selectNew);
171 bool scaleAroundPivot,
196 template <
class TElemIter>
200 TElemIter elemsBegin,
208 vector<elem_ptr_t> elems(elemsBegin, elemsEnd);
211 for(
size_t i_elem = 0; i_elem < elems.size(); ++i_elem){
212 elem_ptr_t e = elems[i_elem];
217 for(
size_t i = 0; i < e->num_vertices(); ++i){
219 VecScaleAdd(aaPos[vrts[i]], scale, aaPos[e->vertex(i)], 1. - scale, c);
252 bool allowForTetsAndPyras);
void push_back(Vertex *vrt)
void erase(const GeomObjIter &iterBegin, const GeomObjIter &iterEnd)
EdgeIterator create_by_cloning(Edge *pCloneMe, const IVertexGroup &ev, GridObject *pParent=NULL)
position_accessor_t & position_accessor()
returns accessor to vertex positions
Definition: mesh.h:113
Grid & grid()
Definition: mesh.h:99
UG_API TVertexPositionAttachmentAccessor::ValueType CalculateCenter(const Edge *e, TVertexPositionAttachmentAccessor &aaPosVRT)
void Tetrahedralize(Mesh *obj, number quality, bool preserveOuter, bool preserveAll, bool separateVolumes, bool appendSubsetsAtEnd, int verbosity)
Definition: remeshing_tools.cpp:356
void ExtrudeToThickness(Mesh *obj, number thickness, int numSteps, bool createFaces, bool createVolumes)
Definition: remeshing_tools.cpp:686
void ClearVolumeConstraints(Mesh *obj)
Definition: remeshing_tools.cpp:404
void CSGFaceOperation(Mesh *obj, CSGOperation op, int subsetIndex0, int subsetIndex1, number snapThreshold)
Definition: remeshing_tools.cpp:976
void ProjectToTopLayer(Mesh *obj, RasterLayers &layers)
Definition: remeshing_tools.cpp:945
void TriangleFill(Mesh *obj, bool qualityGeneration, number minAngle, int si)
Definition: remeshing_tools.cpp:149
void ReplaceLowValenceVertices(Mesh *obj, number maxSquaredHeightToBaseAreaRatio)
Definition: remeshing_tools.cpp:916
void MeshLayerBoundaries(Mesh *m, const RasterLayers &layers)
Definition: remeshing_tools.cpp:935
void ReplaceValence3Vertices(Mesh *obj, number maxSquaredHeightToBaseAreaRatio)
Definition: remeshing_tools.cpp:923
void Duplicate(Mesh *obj, const vector3 &offset, bool deselectOld, bool selectNew)
Definition: remeshing_tools.cpp:432
void ExtrudeFacesWithTets(Mesh *obj, int fromSi, int toSi, const number factor)
Definition: remeshing_tools.cpp:95
void ConvertToTetrahedra(Mesh *obj)
Definition: remeshing_tools.cpp:347
void ExtrudeAndMove(Mesh *obj, const vector3 &totalDir, int numSteps, bool createFaces, bool createVolumes)
Definition: remeshing_tools.cpp:439
void ProjectToLayer(Mesh *obj, RasterLayers &layers, int layerIndex)
Definition: remeshing_tools.cpp:941
void Retriangulate(Mesh *obj, number minAngle)
Definition: remeshing_tools.cpp:249
void Retetrahedralize(Mesh *obj, number quality, bool preserveOuter, bool preserveAll, bool applyVolumeConstraint, int verbosity)
Definition: remeshing_tools.cpp:409
void CSGFaceDifference(Mesh *obj, int subsetIndex0, int subsetIndex1, number snapThreshold)
Definition: remeshing_tools.cpp:1120
void CSGFaceIntersection(Mesh *obj, int subsetIndex0, int subsetIndex1, number snapThreshold)
Definition: remeshing_tools.cpp:1111
void ExtrudeAndScale(Mesh *obj, number totalScale, bool scaleAroundPivot, int numSteps, bool createFaces, bool createVolumes)
Definition: remeshing_tools.cpp:494
void AdjustEdgeLength(Mesh *obj, number minEdgeLen, number maxEdgeLen, int numIterations, bool adaptive, bool automarkBoundaries)
Definition: remeshing_tools.cpp:264
void MeshLayers(Mesh *m, const RasterLayers &layers)
Definition: remeshing_tools.cpp:930
void CreateShrinkElements(Mesh *obj, number scale, TElemIter elemsBegin, TElemIter elemsEnd)
Definition: remeshing_tools.h:197
void SnapToHorizontalRaster(Mesh *obj, SPRasterLayers layers)
Definition: remeshing_tools.cpp:971
void SimplifySmoothedPolylines(Mesh *m, number curvatureThreshold, number smoothingAlpha, int smoothingIterations)
Definition: remeshing_tools.cpp:48
void SimplifyPolylines(Mesh *m, number curvatureThreshold)
Definition: remeshing_tools.cpp:40
void AdjustEdgeLengthExtended(Mesh *obj, number minEdgeLen, number maxEdgeLen, number approximation, number triQuality, int numIterations, bool automarkBoundaries)
Definition: remeshing_tools.cpp:290
void ExtrudeLayersAndAddProjector(Mesh *obj, SPRasterLayers layers, bool allowForTetsAndPyras)
Definition: remeshing_tools.cpp:955
void ConvertToQuadrilaterals(Mesh *obj)
Definition: remeshing_tools.cpp:73
void AdaptSurfaceToCylinder(Mesh *obj, number radius, number threshold)
Definition: remeshing_tools.cpp:321
void AssignVolumeConstraints(Mesh *obj, number volConstraint)
Definition: remeshing_tools.cpp:392
void ExtrudeCylinders(Mesh *obj, number height, number radius, number snapThreshold)
Definition: remeshing_tools.cpp:873
void CSGFaceUnion(Mesh *obj, int subsetIndex0, int subsetIndex1, number snapThreshold)
Definition: remeshing_tools.cpp:1102
CSGOperation
Definition: remeshing_tools.h:256
void CreateShrinkGeometry(Mesh *obj, number scale)
Definition: remeshing_tools.cpp:902
void ExtrudeLayers(Mesh *obj, RasterLayers &layers, bool allowForTetsAndPyras)
Definition: remeshing_tools.cpp:950
void ConvertToTriangles(Mesh *obj)
Definition: remeshing_tools.cpp:63
void ExtrudeAlongNormal(Mesh *obj, number totalLength, int numSteps, bool createFaces, bool createVolumes)
Definition: remeshing_tools.cpp:575
@ CSG_UNION
Definition: remeshing_tools.h:257
@ CSG_INTERSECTION
Definition: remeshing_tools.h:258
@ CSG_DIFFERENCE
Definition: remeshing_tools.h:259
void VecScaleAdd(double &dest, double alpha1, const double &v1, double alpha2, const double &v2)