ug4
remeshing

remeshing algorithms More...

Classes

struct  ug::AdjustEdgeLengthDesc
 

Enumerations

enum  ug::RemeshingElementMarks { ug::REM_NONE = -1 , ug::REM_CREASE = 0 , ug::REM_FIXED = 1 }
 

Functions

bool ug::AdaptSurfaceGridToCylinder (Selector &selOut, Grid &grid, Vertex *vrtCenter, const vector3 &normal, number radius, number rimSnapThreshold, AInt &aInt, APosition &aPos=aPosition)
 Performs local remeshing so that the grid is adapted to the given cylinder. More...
 
bool ug::AdaptSurfaceGridToCylinder (Selector &selOut, Grid &grid, Vertex *vrtCenter, const vector3 &normal, number radius, number rimSnapThreshold, APosition &aPos=aPosition)
 Performs local remeshing so that the grid is adapted to the given cylinder. More...
 
bool ug::AdjustEdgeLength (Grid &grid, SubsetHandler &shMarks, const AdjustEdgeLengthDesc &desc, int numIterations)
 
bool ug::AdjustEdgeLength (Grid &grid, SubsetHandler &shMarks, number minEdgeLen, number maxEdgeLen, int numIterations, bool projectPoints, bool adaptive)
 

Detailed Description

remeshing algorithms

Remeshing algorithms change the topology of a grid in order to e.g. adapt it to a given shape or to optimize its triangle aspect ratios.

Enumeration Type Documentation

◆ RemeshingElementMarks

Enumerator
REM_NONE 
REM_CREASE 
REM_FIXED 

Function Documentation

◆ AdaptSurfaceGridToCylinder() [1/2]

bool ug::AdaptSurfaceGridToCylinder ( Selector selOut,
Grid grid,
Vertex vrtCenter,
const vector3 normal,
number  radius,
number  rimSnapThreshold,
AInt aInt,
APosition aPos = aPosition 
)

Performs local remeshing so that the grid is adapted to the given cylinder.

This algorithm uses Grid::mark.

The resulting grid features an edge-loop that approximates the intersection of the cylinder with the grid-surface. New faces are inserted accordingly.

Please note that volumes-geometries are not supported.

The given selector (sel) will contain the faces that lie inside the cylinder when the algorithm is done.

aInt has to be attached to the edges of the grid. It will be used to store temporary values. Initial values are ignored.

The algorithm requires the option FACEOPT_AUTOGENERATE_EDGES in grid. If it isn't enabled it will be automatically enabled.

An overloaded and somewhat slower version of this method exists, which automatically creates the aInt attachment. It is thus a little more comfortable for the caller.

Parameters
rimSnapThresholdIf a vertex lies closer to the rim than rimSnapThreshold, then it will be projected to the rim.

References ug::Grid::associated_elements(), ug::Selector::clear(), ug::DistancePointToRay(), ug::GetConnectedVertex(), ug::Grid::has_vertex_attachment(), ug::ISelector::is_selected(), ug::MakeGeometry3d(), ug::FaceVertices::num_vertices(), boost::num_vertices(), p, ug::ProjectPointToRay(), ug::RayCylinderIntersection(), Refine(), ug::ISelector::select(), ug::PointerConstArray< TPtr >::size(), ug::SMALL, ug::Triangulate(), UG_THROW, ug::VecDistanceSq(), ug::VecNormalize(), ug::VecScaleAdd(), ug::VecSubtract(), and ug::FaceVertices::vertex().

Referenced by ug::ExtrudeCylinder().

◆ AdaptSurfaceGridToCylinder() [2/2]

bool ug::AdaptSurfaceGridToCylinder ( Selector selOut,
Grid grid,
Vertex vrtCenter,
const vector3 normal,
number  radius,
number  rimSnapThreshold,
APosition aPos = aPosition 
)

Performs local remeshing so that the grid is adapted to the given cylinder.

This is an overloaded version of AdaptSurfaceGridToCylinder. You don't have to pass an edge-integer-attachment to this version, which makes it a little more comfortable, but at the same time slower. You should worry about this slow-down if you intend to call this method multiple times. You should then consider to call the faster version of AdaptSurfaceGridToCylinder, which takes aInt as a parameter.

Parameters
rimSnapThresholdIf a vertex lies closer to the rim than rimSnapThreshold, then it will be projected to the rim.

References ug::Grid::attach_to_edges(), and ug::Grid::detach_from_edges().

◆ AdjustEdgeLength() [1/2]

◆ AdjustEdgeLength() [2/2]