ug4
|
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) |
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.
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.
rimSnapThreshold | If 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().
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.
rimSnapThreshold | If 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().
UG_API bool ug::AdjustEdgeLength | ( | Grid & | grid, |
SubsetHandler & | shMarks, | ||
const AdjustEdgeLengthDesc & | desc, | ||
int | numIterations | ||
) |
Splits all edges that are too long and collapses edges that are too short.
marks: 0 = normal, 1 = crease, 2 = fixed
References ug::aPosition, ug::AssignCreaseVertices(), ug::AssignFixedVertices(), ug::Grid::attach_to(), ug::Grid::begin(), ug::CalculateVertexNormals(), ug::CreateOctree(), ug::Grid::detach_from(), ug::Grid::enable_options(), ug::ISelector::enable_selection_inheritance(), ug::Grid::end(), ug::FACEOPT_AUTOGENERATE_EDGES, ug::node_tree::Traverser_ProjectPoint::get_closest_point(), ug::ISubsetHandler::get_subset_index(), GPLOTSAVE, ug::Grid::has_vertex_attachment(), LOG, ug::Grid::num(), ug::Grid::option_is_enabled(), ug::PerformCollapses(), ug::PerformSplits(), PROFILE_FUNC, ug::node_tree::Traverser_ProjectPoint::project(), ug::AdjustEdgeLengthDesc::projectPoints, ug::REM_FIXED, ug::ISelector::select(), ug::Triangulate(), UG_LOG, SmartPtr< T, FreePolicy >::valid(), ug::Grid::vertices_begin(), and ug::Grid::vertices_end().
UG_API bool ug::AdjustEdgeLength | ( | Grid & | grid, |
SubsetHandler & | shMarks, | ||
number | minEdgeLen, | ||
number | maxEdgeLen, | ||
int | numIterations, | ||
bool | projectPoints = true , |
||
bool | adaptive = true |
||
) |
Splits all edges that are too long and collapses edges that are too short.
marks: 0 = normal, 1 = crease, 2 = fixed
References ug::aPosition, ug::AssignCreaseVertices(), ug::AssignFixedVertices(), ug::Grid::attach_to(), ug::Grid::begin(), ug::CalculateVertexNormals(), ug::node_tree::CreateOctree(), ug::Grid::detach_from(), ug::Grid::enable_options(), ug::ISelector::enable_selection_inheritance(), ug::Grid::end(), ug::FACEOPT_AUTOGENERATE_EDGES, ug::node_tree::Traverser_ProjectPoint::get_closest_point(), ug::ISubsetHandler::get_subset_index(), GPLOTSAVE, ug::Grid::has_vertex_attachment(), LOG, ug::Grid::num(), ug::Grid::option_is_enabled(), ug::PerformCollapses(), ug::PerformSplits(), ug::PerformSwaps(), PROFILE_FUNC, ug::node_tree::Traverser_ProjectPoint::project(), ug::REM_FIXED, ug::ISelector::select(), ug::Triangulate(), UG_LOG, SmartPtr< T, FreePolicy >::valid(), ug::Grid::vertices_begin(), and ug::Grid::vertices_end().