def text(self, en, scene, name):
"""
en: dxf entity
name: ignored; exists to make separate and merged objects methods universally callable from _call_types()
Returns a new single line text object.
"""
if self.import_text:
name = en.text[:8]
d = bpy.data.curves.new(name, "FONT")
d.body = en.plain_text()
d.size = en.height
o = bpy.data.objects.new(name, d)
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))
o.location = self.proj((en.insert)) + basepoint
if hasattr(en, "thickness"):
et = en.thickness / 2
d.extrude = abs(et)
if et > 0:
o.location.z += et
elif et < 0:
o.location.z -= et
return o
评论列表
文章目录