|
Wildmeshing Toolkit
|
#include <CompositeEnvelopes.hpp>
Public Member Functions | |
| IntersectionEnvelope (std::vector< std::shared_ptr< Envelope > > members) | |
| bool | is_outside (const std::array< Eigen::Vector3d, 3 > &tris) const override |
| bool | is_outside (const Eigen::Vector3d &pts) const override |
| bool | is_outside (const std::array< Eigen::Vector2d, 2 > &edge) const override |
| bool | is_outside (const Eigen::Vector2d &pts) const override |
| const std::vector< std::shared_ptr< Envelope > > & | members () const |
Public Member Functions inherited from wmtk::Envelope | |
| Envelope (bool exact=true) | |
| void | set_max_threads (int n) |
| How many threads one triangle query may use. 1, the default: every sample is checked on the calling thread. | |
| virtual void | init (const std::vector< Eigen::Vector3d > &m_ver, const std::vector< Eigen::Vector3i > &m_faces, const double) |
| void | init (const std::vector< Eigen::Vector3d > &m_ver, const std::vector< Eigen::Vector2i > &m_edges, const double) |
| void | init (const std::vector< Eigen::Vector2d > &m_ver, const std::vector< Eigen::Vector2i > &m_edges, const double) |
| void | init (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const double eps) |
| Same, from Eigen matrices, dispatching on the column counts. | |
| bool | is_outside (const std::array< Eigen::Vector3d, 2 > &edge) const |
| double | nearest_point (const Eigen::Vector3d &pts, Eigen::Vector3d &result) const |
| double | nearest_point (const Eigen::Vector2d &pts, Eigen::Vector2d &result) const |
| double | nearest_point_feature (const Eigen::Vector2d &p, Eigen::Vector2d &result, bool &on_corner, Eigen::Vector2d &seg_normal, int &feature_id) const |
| double | nearest_point_feature (const Eigen::Vector3d &p, Eigen::Vector3d &result, int &feature_dim, Eigen::Vector3d &dir, long long &feature_id) const |
| bool | initialized () |
| Kind | kind () const |
| double | squared_distance (const Eigen::Vector3d &p) const |
| double | squared_distance (const Eigen::Vector2d &p) const |
| void | primitives_in_box (const Eigen::Vector3d &lo, const Eigen::Vector3d &hi, std::vector< int64_t > &ids) const |
| The ids of every primitive whose bounding box meets the closed box [lo, hi], ascending, each once. | |
| void | primitives_in_box (const Eigen::Vector2d &lo, const Eigen::Vector2d &hi, std::vector< int64_t > &ids) const |
| The 2D counterpart, for Edges2d: the same tree, which holds the 2D input lifted to z = 0. | |
| double | primitive_distance (int64_t id, const Eigen::Vector3d &p, Eigen::Vector3d *grad=nullptr, Eigen::Matrix3d *hess=nullptr) const |
The distance d from p to primitive id alone, with its gradient and Hessian when asked for (nullptr = not wanted). | |
| double | primitive_distance (int64_t id, const Eigen::Vector2d &p, Eigen::Vector2d *grad=nullptr, Eigen::Matrix2d *hess=nullptr) const |
| double | primitive_triangle_distance (int64_t id, const std::array< Eigen::Vector3d, 3 > &tri) const |
The distance between the triangle tri and primitive id alone. | |
| double | primitive_segment_distance (int64_t id, const std::array< Eigen::Vector2d, 2 > &seg) const |
The 2D counterpart, for Edges2d: the distance between the segment seg and primitive id alone – a 2D front edge where the 3D query takes a front face. | |
Private Attributes | |
| std::vector< std::shared_ptr< Envelope > > | m_members |
Additional Inherited Members | |
Public Types inherited from wmtk::Envelope | |
| enum class | Kind { Uninitialized , Triangles3d , Edges3d , Edges2d } |
Public Attributes inherited from wmtk::Envelope | |
| double | eps2 = 1e-6 |
| double | eps2_edge = 1e-6 |
| double | sampling_dist = 1e-3 |
| bool | use_exact = true |
| bool | disabled = false |
Containment-only composites over several envelopes, in both dimensions.
Both classes override exactly the four virtual queries of wmtk::Envelope – is_outside(triangle3), is_outside(point3), is_outside(segment2) and is_outside(point2) – which are the only calls the containment paths make.
Both construct their base in sampled mode, use_exact = false: the value the base's default constructor gave them before the default became exact. The flag is inert here – a composite is never init()ed and nothing reads use_exact off one – so this only keeps the change of default from changing anything.
A composite must never reach a caller of the non-virtual Envelope queries: nearest_point, nearest_point_feature, squared_distance, or the edge/2D is_outside overloads. Those bind statically to the base subobject, whose BVH was never built, and dereference null. Such callers are fed by smoothing_energy_envelope(), and that hook returns a single real member envelope by contract – the most-violated one for a junction vertex – never a composite.
Moved here from topological_offset, which built them for its per-tag tubes, when tetwild and triwild began holding each tracked simplex to the envelopes of its own inputs (InputEnvelopes below). Inside means inside every member: the tube intersection. This is what pins a junction simplex to the junction, within eps of each boundary it lies on, and what holds a wire or isolated point of the input complex in place, since those only arise where two or more selected tags meet.
|
inlineoverridevirtual |
Reimplemented from wmtk::Envelope.
|
inlineoverridevirtual |
Reimplemented from wmtk::Envelope.
|
inlineoverridevirtual |
Reimplemented from wmtk::Envelope.
|
inlineoverridevirtual |
Four containment queries are VIRTUAL – the 3D triangle, the 3D point, the 2D segment and the 2D point – so a containment-only composite over several envelopes can answer them. They are exactly what the 3D and the 2D containment paths ask. The 3D segment query is not virtual. See the composites in wmtk/envelope/CompositeEnvelopes.hpp, and the invariant stated there: a composite must never reach the NON-virtual queries, whose BVH it does not have.
Reimplemented from wmtk::Envelope.