Inheritence diagram for xlifepp::PiecewiseParametrization:
Collaboration diagram for xlifepp::PiecewiseParametrization:
PiecewiseParametrization class handles a global parametrization of multiple patches: basically a list of standard parametrizations Main data members: map<Parametrization*, vector<pair<Parametrization*,number_t> > > neighborParsMap: map Parametrization* -> neighbor Parametrizations vector vector<Point> vertices: list of all vertices of parametrizations (stored once) map<Parametrization*, vector<number_t> > vertexIndexes: map Parametrization* -> vertex numbers with parameters correspondance index: u=0->1, u=1->2, v=0->3, v=1->4, w=0->5, w=1->6 the neighbor parametrization and vertexIndexes vector are stored according to the parameters correspondance.
EXPERIMENTAL: global C0 parametrization, additional structures Vector <number_t> ns: the numbers n1, n2, n3 map<Triplet, pair<Parametrization*, Transformation*>>> parsMap: map (i,j,k) -> (Parametrization*, Transformation*) (i=1,n1, ,j=1,n2, k=1,n3) map<Parametrization*, Triplet> parsRMap: reverse map Parametrization* -> i,j,k u in [0,1] if curve, (u,v) in [0,1]x[0,1] if surface, (u,v,w) in [0,1]x[0,1]x[0,1] if volume u-interval [0,1] is split in n1 parts [0,1/n1],[1/n1,2/n1], … [(n1-1)/n1,1] defined if curve v-interval [0,1] is split in n2 parts [0,1/n2],[1/n2,2/n2], … [(n2-1)/n2,1] defined if surface w-interval [0,1] is split in n3 parts [0,1/n3],[1/n3,2/n3], … [(n3-1)/n3,1] defined if volume if defines n1 x n2 x n3 cells (Cijk)on which may be attached a parametrization Pijk or not and a tranfer fuction that maps (u,v,w) -> Tijk(n1*u-i+1, n2*v-j+1, n3*w-k+1) in [0,1]x[0,1]x[0,1] where T: [0,1]x[0,1]x[0,1] -> [0,1]x[0,1]x[0,1] is a linear transformation that maps parameters of Pijk the global parametrization may be discontinuous at interfaces except if the algorithm build continous parametrization by matching parameters on interfaces Note: Parametrization* involved here are shared pointers (no clone), null Transformation pointer means no transformation (say id) transformation pointers should be deleted as they are built on memory stack
locate parametrization related to a physical point, update parameter point q and distance d
locate parametrization or nearest parametrization (generalization of toParameter function) p: point to be located dp: a direction to choose parametrization when on boundary (if void not used) par0 : first parametrization candidate (may be 0) q: parameter point found d: maximal distance p-par(q), output the distance found (if d=0, search parametrization such that par(q)=p) return Parametrization if found else return 0, q and d are updated
when d>0 and p does not belongs to a patch, for each parametrization a “projection” of p is done and the smallest distance (if <d) gives the parametrization the projection is the following: . project p on the linear patchs get from vertices of the parametrization. It gives some barycentric coordinates (l1,l2,…) related to the vertices . use this barycentric coordinates to get a parameter q by linear interpolation . project q on the parameters domain . “projection” of p: pr = par(q) and distance = norm(pr-p);
when there is more than one admissible parametrizations and one dp direction, the parametrizations selected is the one with the smallest angle between the projection of dp and dp inverse function of the parametrization