31 #ifndef _FACE_OFFSET_3_H_
32 #define _FACE_OFFSET_3_H_
40 typedef std::map<Edge_ID,std::pair<int, int> >
ObscendSet;
57 virtual double time_stepping(
const COM::Attribute *spds,
double dt,
58 COM::Attribute *disps,
int *smoothed=NULL);
136 COM::Attribute *
rhs, COM::Attribute *predicted);
146 COM::Attribute *vcenters);
159 const bool upgrade_ridge,
160 COM::Attribute *neighbor_feas,
161 COM::Attribute *tr_attr,
167 const COM::Attribute *mintrnangv,
168 const std::vector<std::map<Edge_ID, double> > &edge_maps,
169 const COM::Attribute *maxranglev,
170 const COM::Attribute *minranglev,
171 const std::vector<std::map<Edge_ID, double> > &rangle_maps,
172 std::vector< ObscendSet > &obscends);
175 const COM::Attribute *mintrnangv,
176 const std::vector<std::map<Edge_ID, double> > &edge_maps,
177 const COM::Attribute *maxranglev,
178 const COM::Attribute *minranglev,
179 const std::vector<std::map<Edge_ID, double> > &rangle_maps);
183 const std::vector<std::map<Edge_ID, double> > &diangl_maps,
184 const std::vector< ObscendSet > &obscends);
193 const COM::Attribute *tangranks,
194 const COM::Attribute *disps,
195 COM::Attribute *vcenters,
197 COM::Attribute *vert_weights_buf,
198 const COM::Attribute *edge_weights=NULL);
205 const COM::Attribute *tranks,
206 COM::Attribute *vvol);
209 const COM::Attribute *vdsps,
210 COM::Attribute *fvol);
219 std::pair<double,double>
228 double angle_defect=0);
236 const COM::Attribute *spd,
double dt,
238 COM::Element_node_enumerator &ene,
252 COM::Attribute *normal_motion);
258 for (
int i=0;
i<3-trank; ++
i) prim += nrm*es[
i]*es[
i];
271 static void solve (
const FT &a1,
const FT &a2,
272 const FT &b1,
const FT &b2,
273 const FT &c1,
const FT &c2,
276 FT
denom = a1*b2-b1*a2;
278 x = - (b1*c2-c1*b2)/denom;
280 y = (a1*c2-c1*a2)/denom;
284 static void solve (
const FT &a1,
const FT &a2,
const FT &a3,
285 const FT &b1,
const FT &b2,
const FT &b3,
286 const FT &c1,
const FT &c2,
const FT &c3,
287 const FT &d1,
const FT &d2,
const FT &d3,
290 FT
denom = b2*c1*a3-b1*c2*a3+c3*b1*a2+b3*c2*a1-c1*b3*a2-b2*c3*a1;
292 x = - (b2*c3*d1-b2*c1*d3+c1*b3*d2+b1*c2*d3-c3*b1*d2-b3*c2*d1)/denom;
294 z = (b2*d1*a3-b2*a1*d3+b1*a2*d3-b1*d2*a3-d1*b3*a2+a1*b3*d2)/denom;
296 y = (a2*c3*d1-a2*c1*d3-c2*d1*a3+c2*a1*d3+d2*c1*a3-d2*c3*a1)/denom;
303 solve( A[0][0], A[0][1], A[0][2], A[1][0], A[1][1], A[1][2],
304 A[2][0], A[2][1], A[2][2], q[0], q[1], q[2],
309 std::pair<double,double>
325 if ( sqrnrm==0)
return 0;
327 if (s>1) s=1;
else if (s<-1) s =-1;
333 if ( sqrnrm==0)
return 0;
335 if (s>1) s=1;
else if (s<-1) s =-1;
353 const Vector_3 &mn,
int nrank)
const {
358 const Vector_3 &mn,
int nrank)
const {
366 const Vector_3 &mn,
int nrank)
const;
429 static const double pi;
COM::Attribute * _ridgeneighbors
void set_wavefrontal_expansion(bool b)
Set the wavefrontal switch.
SURF::Vector_2< Real > Vector_2
static void compute_eigenvectors(Vector_3 A[3], Vector_3 &lambdas)
COM::Attribute * _eigvalues
void compute_volume_vector(const COM::Attribute *disps, COM::Attribute *bs)
Compute volumn-vector.
int insert_boundary_edges(COM::Attribute *tr_attr)
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
void set_fangle_turn(double psi)
Set the threshold for weak-feature angle.
std::pair< double, double > comp_wavefrontal_motion(double det, double w, double delta, const Vector_3 &disp_nz, const Vector_3 &nrm_nz)
#define PROP_END_NAMESPACE
virtual double time_stepping(const COM::Attribute *spds, double dt, COM::Attribute *disps, int *smoothed=NULL)
Main entry of the algorithm.
void int int REAL REAL * y
void obtain_face_offset(const Point_3 *pnts, const double *spd_ptr, const COM::Attribute *spd, double dt, const Vector_3 *dirs, COM::Element_node_enumerator &ene, Vector_3 &ns_nz, Point_3 &cnt, Vector_3 *disps, Vector_3 *ns)
void filter_and_identify_ridge_edges(bool filter_curves)
Filter out isolated ridge vertices and identify ridge edges.
bool obtain_constrained_directions(COM::Attribute *disps, COM::Attribute *vcenters)
Decompose propagation directions based on constraints.
static double eval_angle(const Vector_2 &v1, const Vector_2 &v2)
#define PROP_BEGIN_NAMESPACE
static void solve(const FT &a1, const FT &a2, const FT &a3, const FT &b1, const FT &b2, const FT &b3, const FT &c1, const FT &c2, const FT &c3, const FT &d1, const FT &d2, const FT &d3, FT &x, FT &y, FT &z)
COM::Attribute * _vcenters
COM::Attribute * _faceareas
COM::Attribute * _boffset
void update_vertex_centers()
void get_primary_component(const Vector_3 &nrm, const Vector_3 es[], int trank, Vector_3 &prim) const
void compute_directions(COM::Attribute *b_offset, bool in_principle)
Compute mean normals.
SURF::Vector_3< Real > Vector_3
COM::Attribute * _tangranks
void set_weighting_scheme(int w)
Weighting scheme.
void set_fangle_weak(double psi)
Set the threshold for weak-feature angle.
CImg< _cimg_Tfloat > tan(const CImg< T > &instance)
std::pair< double, double > solve_quadratic_func(double a, double b, double c)
static void solve(const Vector_3 A[3], const Vector_3 &q, Vector_3 &x)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
void set_fangle_strong(double psi)
Set the threshold for weak-feature angle.
void denoise_surface(const COM::Attribute *disps_buf, COM::Attribute *normal_motion)
COM::Attribute * _eigvecs
static double square(double x)
bool is_strong(const Vector_3 *es, const Vector_3 &lambdas, const Vector_3 &mn, int nrank) const
COM::Attribute * _facecenters
Type squared_norm() const
int get_weighting_scheme() const
Vector_3 compute_weighted_normal(Vector_3 es[3], const Vector_3 &lambdas, int trank, const Vector_3 &mean_nrm, const Vector_3 &face_nrm)
void distribute_volume_e2n(const COM::Attribute *fvol, const COM::Attribute *tranks, COM::Attribute *vvol)
bool is_acute_ridge(const Vector_3 *es, const Vector_3 &lambdas, const Vector_3 &mn, int nrank) const
SURF::Window_manifold_2 Manifold
void int int int REAL REAL REAL * z
double get_fangle_weak_radians() const
Get the threshold for weak-feature angle.
void set_conserve(int b)
Set mass conservation.
void compute_quadrics(double dt, const COM::Attribute *spds, COM::Attribute *rhs, COM::Attribute *predicted)
Compute quadrics for every vertex.
void reset_default_parameters(bool b=false)
void reclassify_ridge_vertices(const bool upgrade_corners, const bool upgrade_ridge, COM::Attribute *neighbor_feas, COM::Attribute *tr_attr, bool to_filter)
COM::Attribute * _bmedial
std::map< Edge_ID, std::pair< int, int > > ObscendSet
COM::Attribute * _weights
int build_ridge_neighbor_list(const COM::Attribute *maxtrnangv, const COM::Attribute *mintrnangv, const std::vector< std::map< Edge_ID, double > > &edge_maps, const COM::Attribute *maxranglev, const COM::Attribute *minranglev, const std::vector< std::map< Edge_ID, double > > &rangle_maps, std::vector< ObscendSet > &obscends)
Build the list of ridge nighbors and obtain a list of weak-ended vertices Return the number of obscen...
Type squared_norm() const
void update_face_volumes(const COM::Attribute *fnormal, const COM::Attribute *vdsps, COM::Attribute *fvol)
void obtain_directions(Vector_3 es[3], const Vector_3 &lambdas, int nrank, Vector_3 &b_medial, Vector_3 *b_offset=NULL) const
void compute_anisotropic_vertex_centers(const COM::Attribute *disps_buf)
bool is_acute_corner(const Vector_3 *es, const Vector_3 &lambdas, const Vector_3 &mn, int nrank) const
static double eval_angle(const Vector_3 &v1, const Vector_3 &v2)
double get_fangle_strong_radians() const
Get the threshold for strong-feature angle.
int append_obscure_ends(const COM::Attribute *maxtrnangv, const COM::Attribute *mintrnangv, const std::vector< std::map< Edge_ID, double > > &edge_maps, const COM::Attribute *maxranglev, const COM::Attribute *minranglev, const std::vector< std::map< Edge_ID, double > > &rangle_maps)
double get_eigen_threshold() const
Get the threshold of eigenvalues for splitting primary and null spaces.
double det(const Matrix3D &A)
static void solve(const FT &a1, const FT &a2, const FT &b1, const FT &b2, const FT &c1, const FT &c2, FT &x, FT &y)
double get_courant_constant() const
Get the constant in front of CFL condition (0<=c<=1)
void mark_weak_vertices()
Mark vertices that are weak.
int get_normal_diffuion() const
Get number of iterations for normal diffusion.
double rescale_displacements(COM::Attribute *disps, COM::Attribute *vcenters, int depth=0)
Reduce time step based on stability limit, and rescale displacements by the reduced time step and dif...
double get_fangle_turn_radians() const
Set the threshold for weak-feature angle.
void set_feature_layer(bool b)
Set whether or not to use feature layer.
std::vector< std::set< Edge_ID > > _edges
bool get_wavefrontal_expansion() const
Obtain the wavefrontal switch.
void set_courant_constant(double c)
Set the constant in front of CFL condition (0<=c<1)
COM::Attribute * _vnormals
CImg< _cimg_Tfloat > acos(const CImg< T > &instance)
Some basic geometric data types.
double get_nonuniform_weight(const Vector_3 &lambdas, int trank)
void adjust_wavefrontal_motion(COM::Attribute *disps)
int remove_obscure_curves(const std::vector< ObscendSet > &obscends)
static Vector_2 proj(const Vector_3 &v, const Vector_3 &d1, const Vector_3 &d2)
void get_tangents(const Vector_3 *es, const Vector_3 &lambdas, const Vector_3 &mn, int nrank, Vector_3 vs[2], double scales[2], int *is_strong=NULL) const
void set_normal_diffusion(char i)
Set number of iterations for normal diffusion.
void set_eigen_threshold(double eps)
Set the threshold of eigenvalues for splitting primary and null spaces.
bool filter_obscended_ridge(const std::vector< std::map< Edge_ID, double > > &edge_maps, const std::vector< std::map< Edge_ID, double > > &diangl_maps, const std::vector< ObscendSet > &obscends)
Filter out weak-ended curves.
void numerical_dissipation(COM::Attribute *nodal_buffer)
Introduce numerical dissipation into equation.
CGAL_BEGIN_NAMESPACE void const NT NT NT NT & denom
This class provides some common primitives used by various propagation algorithms.
void nulaplacian_smooth(const COM::Attribute *vert_normals, const COM::Attribute *tangranks, const COM::Attribute *disps, COM::Attribute *vcenters, COM::Attribute *buf, COM::Attribute *vert_weights_buf, const COM::Attribute *edge_weights=NULL)
Redistribute smooth vertices by NuLaplacian smoothing.
FaceOffset_3()
Default constructor.
void set_smoother(int smoother)
Set the choice of mesh smoother.
COM::Attribute * _facenormals
COM::Attribute * _ctangranks
int eigen_analyze_vertex(Vector_3 A_io[3], Vector_3 &b_io, double angle_defect=0)