Forum de la communauté Allplan

[Question] Zusammengesetzte 2D Profile extrudieren, Polyhedron aus 2D Polygon [Résolu]


Hallo,

gibt es die Möglichkeit aus einem zusammengesetzten 2D Profil (Kreise + Linien) einen 3D Körper zu extrudieren?
Gefunden habe ich die Möglichkeit aus einem 2D Polygon ein Polyhedron zu erzeugen.
Im Beispiel wird jedoch auch nur ein Rechteck verwendet.

Ich denke bei den Smartparts wäre das die Funktion Extrude, in der Doku der PPs wird hier auch Polyhedron als entsprechende Funktion beschrieben.

Im Grunde stelle sich somit die Frage, wie bekomme ich Kreissegmente in das 2D Polygon bekomme...

Danke für Rückmeldungen!

VG
Marcus

Show solution Hide solution

Hallo,

1. runder Körper mit BRep:
Linien und Kreise als 3D-Elemente erzeugen und zu einem Path3D verbinden.
Mit diesem Path3D ein planares BRep erstellen (CreatePlanarBRep3D).
Das planare BRep zu einem Körper "Loften"(CreateLoftedBRep3D) oder "Sweepen" (CreateSweptBRep3D).

2. Polygonisierung eines 2D-Kreises:
Scheinbar im Allplan-Python-Wrapper nicht implementiert.
Aber in meinem eigenen Python-Plugin schon :-)
Wenn Interesse besteht, bitte PM an mich...

Gruß Jörg

11 - 12 (12)

..der Create-Aufruf hat 2-RückgabeParameter:

err, brep = AllplanGeo.CreateSweptBRep3D(base_path, path, railrotation, axis)
if not GeometryValidate.polyhedron(err):
return
return AllplanBasisElements.ModelElement3D(com_prop,brep )

Ohne das wird versucht mit err ein ModelElement3D zu erzeugen, was natürlich scheitert :-)

Yeahh!
Selten hab ich mich über einen "einfachen" Würfel so gefreut
Vielen Dank für deine Hilfe!!

Zur Dokumentation für nachfolgende Einsteiger nochmals die korrekte Fassung der Methode.

    def brep_path3d(self, build_ele):
        base_path = AllplanGeo.Path3D()
        base_path += AllplanGeo.Line3D(AllplanGeo.Point3D(0,0,0), AllplanGeo.Point3D(100,0,0))
        base_path += AllplanGeo.Line3D(AllplanGeo.Point3D(100,0,0), AllplanGeo.Point3D(100,100,0))
        base_path += AllplanGeo.Line3D(AllplanGeo.Point3D(100,100,0), AllplanGeo.Point3D(0,100,0))
        base_path += AllplanGeo.Line3D(AllplanGeo.Point3D(0,100,0), AllplanGeo.Point3D(0,0,0))
        axis = AllplanGeo.Vector3D(0,100,0)
        path = AllplanGeo.Path3D()
        path += AllplanGeo.Line3D(AllplanGeo.Point3D(0,0,0), AllplanGeo.Point3D(0,0,100))
        railrotation = True
        surf = AllplanBasisElements.TextureDefinition("alu")
        err, brep = AllplanGeo.CreateSweptBRep3D(base_path, path, railrotation, axis)
        if not GeometryValidate.polyhedron(err):
            return
        print(brep)
        com_prop = AllplanBaseElements.CommonProperties()
        com_prop.GetGlobalProperties()
        return AllplanBasisElements.ModelElement3D(com_prop, surf, 0,0 ,brep)

Grüße
Marcus

VG
Marcus

Pièces-jointes (1)

Type: image/jpeg
Téléchargé 167 fois
Size: 24,59 KiB
11 - 12 (12)

https://connect.allplan.com/ utilise des cookies  -  Plus d'informations

Accepter