Changeset View
Changeset View
Standalone View
Standalone View
io_import_dxf/dxfimport/do.py
| Context not available. | |||||
| if p1.srs != p2.srs: | if p1.srs != p2.srs: | ||||
| return proj_transform(p1, p2, c1, c2, c3) | return proj_transform(p1, p2, c1, c2, c3) | ||||
| else: | else: | ||||
| return (c1, c2, c3) | return c1, c2, c3 | ||||
| elif type(p2) is TransverseMercator: | elif type(p2) is TransverseMercator: | ||||
| wgs84 = Proj(init="EPSG:4326") | wgs84 = Proj(init="EPSG:4326") | ||||
| if p1.srs != wgs84.srs: | if p1.srs != wgs84.srs: | ||||
| Context not available. | |||||
| else: | else: | ||||
| t1, t2, t3 = c2, c1, c3 # mind c2, c1 inversion | t1, t2, t3 = c2, c1, c3 # mind c2, c1 inversion | ||||
| tm1, tm2 = p2.fromGeographic(t1, t2) | tm1, tm2 = p2.fromGeographic(t1, t2) | ||||
| return (tm1, tm2, t3) | return tm1, tm2, t3 | ||||
| else: | else: | ||||
| if p1.spherical: | if p1.spherical: | ||||
| t1, t2 = p2.fromGeographic(c2, c1) # mind c2, c1 inversion | t1, t2 = p2.fromGeographic(c2, c1) # mind c2, c1 inversion | ||||
| return (t1, t2, c3) | return t1, t2, c3 | ||||
| else: | else: | ||||
| return (c1, c2, c3) | return c1, c2, c3 | ||||
| def float_len(f): | def float_len(f): | ||||
| Context not available. | |||||
| o = bpy.data.objects.new(name, d) | o = bpy.data.objects.new(name, d) | ||||
| o.rotation_euler = Euler((0, 0, radians(en.rotation)), 'XYZ') | o.rotation_euler = Euler((0, 0, radians(en.rotation)), 'XYZ') | ||||
| basepoint = self.proj(en.basepoint) if hasattr(en, "basepoint") else self.proj((0, 0, 0)) | basepoint = self.proj(en.basepoint) if hasattr(en, "basepoint") else self.proj((0, 0, 0)) | ||||
| o.location = self.proj((en.insert)) + basepoint | o.location = self.proj(en.insert) + basepoint | ||||
| if hasattr(en, "thickness"): | if hasattr(en, "thickness"): | ||||
| et = en.thickness / 2 | et = en.thickness / 2 | ||||
| d.extrude = abs(et) | d.extrude = abs(et) | ||||
| Context not available. | |||||