Exemple #1
0
 def layout_first_two_points(self, meshLoc, start_frame):
     '''
     The process must be started with an island that has one edge, its from face, and the two verts
     for that face and edge. This function adds those verts
     Note that the verts are added in reverse order; this is consistent with the assumption
     of breadth_first_layout.
     '''
     meshPointA, meshPointB = self.myMesh.get_oriented_points_for_edge(
         meshLoc.edge, meshLoc.face)
     self.visited_edges.append(meshLoc.edge)
     from_frame = self.myMesh.get_frame_oriented_with_face_normal(
         meshLoc.edge, meshLoc.face)
     pnt0 = trans.get_mapped_point(meshPointA, from_frame, start_frame)
     pnt1 = trans.get_mapped_point(meshPointB, from_frame, start_frame)
     self.island.add_vert_from_point(pnt1)
     self.island.add_vert_from_point(pnt0)
     meshEdge = meshLoc.edge
     islandEdge = 0
     #NOTE: only works for myMeshes that have cuts set! consider alternatives to deal with this
     if self.myMesh.is_fold_edge(meshEdge):
         self.island.change_to_fold_edge(islandEdge)
     if self.myMesh.is_cut_edge(meshEdge):
         self.island.change_to_cut_edge(islandEdge)
     if self.myMesh.is_naked_edge(meshEdge):
         self.island.change_to_naked_edge(islandEdge)
 def get_mapped_point(self, point, meshLoc, islandLoc):
     from_frame = self.myMesh.get_frame_oriented_with_face_normal(meshLoc.edge, meshLoc.face)
     to_frame = self.island.get_frame_reverse_edge(islandLoc.edge, islandLoc.face)
     if self.visualize_mode:
         from_frame.show()
         to_frame.show()
     return trans.get_mapped_point(point, from_frame, to_frame)
Exemple #3
0
 def get_mapped_point(self, point, meshLoc, islandLoc):
     from_frame = self.myMesh.get_frame_oriented_with_face_normal(
         meshLoc.edge, meshLoc.face)
     to_frame = self.island.get_frame_reverse_edge(islandLoc.edge,
                                                   islandLoc.face)
     if self.visualize_mode:
         from_frame.show()
         to_frame.show()
     return trans.get_mapped_point(point, from_frame, to_frame)
 def layout_first_two_points(self, meshLoc, start_frame):
     """
     The process must be started with an island that has one edge, its from face, and the two verts
     for that face and edge. This function adds those verts
     Note that the verts are added in reverse order; this is consistent with the assumption
     of breadth_first_layout.
     """
     meshPointA, meshPointB = self.myMesh.get_oriented_points_for_edge(meshLoc.edge, meshLoc.face)
     self.visited_edges.append(meshLoc.edge)
     from_frame = self.myMesh.get_frame_oriented_with_face_normal(meshLoc.edge, meshLoc.face)
     pnt0 = trans.get_mapped_point(meshPointA, from_frame, start_frame)
     pnt1 = trans.get_mapped_point(meshPointB, from_frame, start_frame)
     self.island.add_vert_from_point(pnt1)
     self.island.add_vert_from_point(pnt0)
     meshEdge = meshLoc.edge
     islandEdge = 0
     # NOTE: only works for myMeshes that have cuts set! consider alternatives to deal with this
     if self.myMesh.is_fold_edge(meshEdge):
         self.island.change_to_fold_edge(islandEdge)
     if self.myMesh.is_cut_edge(meshEdge):
         self.island.change_to_cut_edge(islandEdge)
     if self.myMesh.is_naked_edge(meshEdge):
         self.island.change_to_naked_edge(islandEdge)
 def test_get_mapped_point(self):
     from_frame = trans.Frame.create_frame_from_normal_and_x(
         origin = geom.Point3d(1,-2,1),
         normal = geom.Vector3d(0,0,1),
         x = geom.Vector3d(1,0,0))
     from_frame.show()
     to_frame = trans.Frame.create_frame_from_normal_and_x(
         origin = geom.Point3d(3,3,0),
         normal = geom.Vector3d(0,0,1),
         x = geom.Vector3d(-1,0,0))
     to_frame.show()
     pnt = geom.Point3d(2,-1,1)
     correct_point = geom.Point3d(2,2,0)
     new_point = trans.get_mapped_point(pnt,from_frame,to_frame)
     self.assertTrue(correct_point.Equals(new_point))
     rs.AddPoint(pnt)
     rs.AddPoint(new_point)
     rs.AddPoint(correct_point)
 def test_get_mapped_point(self):
     from_frame = trans.Frame.create_frame_from_normal_and_x(
         origin=geom.Point3d(1, -2, 1),
         normal=geom.Vector3d(0, 0, 1),
         x=geom.Vector3d(1, 0, 0))
     from_frame.show()
     to_frame = trans.Frame.create_frame_from_normal_and_x(
         origin=geom.Point3d(3, 3, 0),
         normal=geom.Vector3d(0, 0, 1),
         x=geom.Vector3d(-1, 0, 0))
     to_frame.show()
     pnt = geom.Point3d(2, -1, 1)
     correct_point = geom.Point3d(2, 2, 0)
     new_point = trans.get_mapped_point(pnt, from_frame, to_frame)
     self.assertTrue(correct_point.Equals(new_point))
     rs.AddPoint(pnt)
     rs.AddPoint(new_point)
     rs.AddPoint(correct_point)