Exemplo n.º 1
0
 def getWCSBulgeSign(self, norm):
     '''Detect bulge sign in WCS using predefined vectors in OCS
     '''
     p0 = VAcad.trans((0.0, 0.0, 0.0), AutoCAD.acOCS, AutoCAD.acWorld, norm)
     p1 = VAcad.trans((2.0, 1.0, 0.0), AutoCAD.acOCS, AutoCAD.acWorld, norm)
     p2 = VAcad.trans((2.0, 2.0, 0.0), AutoCAD.acOCS, AutoCAD.acWorld, norm)
     return trig.getBulgeSign(p0, p1, p2)
Exemplo n.º 2
0
    def ocs2wcsAngle(self, angle, norm):
        ''' transform angle from OCS to WCS
        '''
        #~ if not (self.norm and self.bulgeSign) or self.norm != norm:
        p0 = self.trans((0.0, 0.0, 0.0), AutoCAD.acOCS, AutoCAD.acWorld, norm)
        p1 = self.trans((2.0, 1.0, 0.0), AutoCAD.acOCS, AutoCAD.acWorld, norm)
        p2 = self.trans((2.0, 2.0, 0.0), AutoCAD.acOCS, AutoCAD.acWorld, norm)
        p10 = self.trans((1.0, 0.0, 0.0), AutoCAD.acOCS, AutoCAD.acWorld, norm)
        self.bulgeSign = trig.getBulgeSign(p0, p1, p2)
        self.zeroAngle = trig.AutoLISP.angleP(p0, p10)
        self.norm = norm

        ta = (self.bulgeSign * self.zeroAngle) + (self.bulgeSign * angle)
        return trig.normAngle2pi(ta)