コード例 #1
0
    def rebuild(self):
        cc = self.impconf.conecyl
        self.cone_geometry = ConeGeometry.from_conecyl(cc, self.extra_height)
        if not cc.alphadeg > 0:
            raise ValueError(
                'PlyPieceImperfection may only be used for cones, i.e. when alpha > 0'
            )
        if len(cc.stack) > len(self.info):
            raise ValueError(
                'Not enough info rows supplied for PlyPieceImperfection.')
        self.models = []
        self.max_deviation = 0

        for i, ply_info in enumerate(self.info):
            if 'starting_position' not in ply_info:
                raise ValueError(
                    "PlyPieceImperfection: Missing parameter 'starting_position' for ply {0}"
                    .format(i))
            if 'max_width' not in ply_info:
                raise ValueError(
                    "PlyPieceImperfection: Missing parameter 'max_width' for ply {0}"
                    .format(i))
            model = TrapezPlyPieceModel(self.cone_geometry, cc.stack[i],
                                        **ply_info)
            self.models.append(model)
            model.rebuild()
            angle_dev = max(
                abs(x - cc.stack[i]) for x in model.corner_orientations())
            self.max_deviation = max(self.max_deviation, angle_dev)
コード例 #2
0
 def buildModel(self):
     # Build the ply piece model
     cg = self.data_handle.cg
     if self.shape == 1:
         model = TrapezPlyPieceModel(cg, self.angle, self.start, self.width, 0.0, self.var)
     elif self.shape == 2:
         model = Trapez2PlyPieceModel(cg, self.angle, self.start, self.width, 0.0, self.var)
     elif self.shape == 3:
         model = RectPlyPieceModel(cg, self.angle, self.start, self.width, 0.0, self.var)
     else:
         assert False # Should never be reached
     model.rebuild()
     return model
コード例 #3
0
ファイル: GUIPlot.py プロジェクト: yuscale/desicos
 def buildModel(self):
     # Build the ply piece model
     cg = self.data_handle.cg
     if self.shape == 1:
         model = TrapezPlyPieceModel(cg, self.angle, self.start, self.width, 0.0, self.var)
     elif self.shape == 2:
         model = Trapez2PlyPieceModel(cg, self.angle, self.start, self.width, 0.0, self.var)
     elif self.shape == 3:
         model = RectPlyPieceModel(cg, self.angle, self.start, self.width, 0.0, self.var)
     else:
         assert False # Should never be reached
     model.rebuild()
     return model
コード例 #4
0
    def rebuild(self):
        cc = self.impconf.conecyl
        self.cone_geometry = ConeGeometry.from_conecyl(cc, self.extra_height)
        if not cc.alphadeg > 0:
            raise ValueError('PlyPieceImperfection may only be used for cones, i.e. when alpha > 0')
        if len(cc.stack) > len(self.info):
            raise ValueError('Not enough info rows supplied for PlyPieceImperfection.')
        self.models = []
        self.max_deviation = 0

        for i, ply_info in enumerate(self.info):
            if 'starting_position' not in ply_info:
                raise ValueError("PlyPieceImperfection: Missing parameter 'starting_position' for ply {0}".format(i))
            if 'max_width' not in ply_info:
                raise ValueError("PlyPieceImperfection: Missing parameter 'max_width' for ply {0}".format(i))
            model = TrapezPlyPieceModel(self.cone_geometry, cc.stack[i], **ply_info)
            self.models.append(model)
            model.rebuild()
            angle_dev = max(abs(x - cc.stack[i]) for x in model.corner_orientations())
            self.max_deviation = max(self.max_deviation, angle_dev)