Support Forum

[Frage] UV-Koordinaten bei Polyhedron3D analog SmartPart-Funktion BODY / TEVE ? [Gelöst]


Hallo

bei den SmartParts kann man mittels den Funktionen BODY und TEVE eine 3D-Fläche mit UV-Koordinaten erstellen. Leider ist die Performance bei «grossen» Smartparts nicht sehr befriedigend.

Daher wollte ich mein Projekt mit den leistungsfähigeren PythonParts umsetzten.
Wie es aber scheint, bietet die Klasse AllplanGeo.Polyhedron3D keine Möglichkeit UV-Koordinaten zuzuweisen. Bleibt dies in der Zukunft auch so? Ober besteht die Hoffnung, dass UV-Koordinaten implementiert werden?

Gruss und Dank
Hansruedi

Lösung anzeigen Lösung verbergen

Die Verwendung von UV-Koordinaten ist bereits seit langem implementiert.

Die Zuweisung passiert über die Klasse TextureMapping.

siehe ETC\Examples\PythonParts\BasisExamples\UVTextureMapping.pyp

texture_mapping = AllplanBasisElements.TextureMapping ()

if use_uv_mapping:
   # define UV texture mapping for cuboid
   coords = AllplanUtil.VecDoubleList()
   coords[:] = [0.25, 0.33, 0.25, 0.66, 0.50, 0.66, 0.50, 0.33,
                0.25, 0.33, 0.00, 0.33, 0.00, 0.66, 0.25, 0.66,
                0.25, 0.66, 0.25, 1.00, 0.50, 1.00, 0.50, 0.66,
                0.25, 0.00, 0.25, 0.33, 0.50, 0.33, 0.50, 0.00,
                0.50, 0.33, 0.50, 0.66, 0.75, 0.66, 0.75, 0.33,
                0.75, 0.33, 0.75, 0.66, 1.00, 0.66, 1.00, 0.33]

   texture_mapping = AllplanBasisElements.TextureMapping (coords)

self.model_ele_list.append(
   AllplanBasisElements.ModelElement3D(
   self.com_prop, self.texture, texture_mapping, AllplanGeo.Polyhedron3D.CreateCuboid(1000,2000,3000)))

Anhänge (2)

Typ: image/png
36-mal heruntergeladen
Größe: 59,32 KiB
Typ: image/png
50-mal heruntergeladen
Größe: 95,22 KiB

Die Verwendung von UV-Koordinaten ist bereits seit langem implementiert.

Die Zuweisung passiert über die Klasse TextureMapping.

siehe ETC\Examples\PythonParts\BasisExamples\UVTextureMapping.pyp

texture_mapping = AllplanBasisElements.TextureMapping ()

if use_uv_mapping:
   # define UV texture mapping for cuboid
   coords = AllplanUtil.VecDoubleList()
   coords[:] = [0.25, 0.33, 0.25, 0.66, 0.50, 0.66, 0.50, 0.33,
                0.25, 0.33, 0.00, 0.33, 0.00, 0.66, 0.25, 0.66,
                0.25, 0.66, 0.25, 1.00, 0.50, 1.00, 0.50, 0.66,
                0.25, 0.00, 0.25, 0.33, 0.50, 0.33, 0.50, 0.00,
                0.50, 0.33, 0.50, 0.66, 0.75, 0.66, 0.75, 0.33,
                0.75, 0.33, 0.75, 0.66, 1.00, 0.66, 1.00, 0.33]

   texture_mapping = AllplanBasisElements.TextureMapping (coords)

self.model_ele_list.append(
   AllplanBasisElements.ModelElement3D(
   self.com_prop, self.texture, texture_mapping, AllplanGeo.Polyhedron3D.CreateCuboid(1000,2000,3000)))

Anhänge (2)

Typ: image/png
36-mal heruntergeladen
Größe: 59,32 KiB
Typ: image/png
50-mal heruntergeladen
Größe: 95,22 KiB

Danke!
Manchmal sieht man den Wald vor lauter Bäumen nicht. ;)


https://connect.allplan.com/ verwendet Cookies  -  Mehr Informationen

Akzeptieren