Das Wissen aller Anwender nutzen

Im Allplan Connect Forum tauschen sich Anwender aus, geben wertvolle Tipps oder beraten sich bei ganz konkreten Aufgabenstellungen − auch international.
Und damit wirklich keine Frage unbeantwortet bleibt, unterstützen die Mitarbeiter des Technischen Supports ebenfalls aktiv das Forum.

Es erwarten Sie:

  • Foren-Vielfalt aus CAD Architektur, CAD Ingenieurbau uvm.
  • Tipps von User für User
  • international: Deutsch, Englisch, Italienisch, Französisch und Tschechisch

Melden Sie sich jetzt an und diskutieren Sie mit!

Zur Registrierung

[Frage] How to handle corrupt geometry with the Python API [Gelöst]


Hello,

I want to apply the NemAll_Python_Geometry.MakeUnion method on two polyhedrons which I retrieved from a fixture. Although they seem to be valid when I test them with Polyhedron3D.IsValid(), the MakeUnion methoud throws an error (eWrongShape) and an empty Polyhedron3D.

When I place the two polyhedrons in the model and try to use the Union tool manually I also get an error ("Solids cannot be modeled"). This is fixed when I apply the "Repair 3D Elements" tool on both elements and then it is possible to Union them both manually and with the API MakeUnion method. Is there a way to repair the polyhedrons with the API? I've tried the Heal() and Normalize() methods but they don't seem to have an effect. I realy would like to handle the 'corrupt' polyhedrons inside the API, is that possible somehow?

I've attached the data to this topic (Export Loaded drawing files with resources) and I've modified the GeometrySelectInteractor.py example to show the case. Output of trace, generated with the modified GeometrySelectInteractor is also attached.

Attached data is from Allplan 2025 WIP-2.

http://www.cadblanche.eu

Anhänge (3)

Typ: application/zip
128-mal heruntergeladen
Größe: 3,41 KiB
Typ: application/zip
134-mal heruntergeladen
Größe: 1,69 KiB
Typ: image/png
20-mal heruntergeladen
Größe: 53,63 KiB

Lösung anzeigen Lösung verbergen

Hello Sander,

If polyhedron faces are non-planar, Heal tries to fix it - either by moving the vertices a little to make them planar, or by triangulating the faces around the "fixed" vertices. Apparently, this is not the issue with your polyhedron.

The repairing the polyhedron with the UI function "Repair" involves 4 steps:

  • Repairing Cross Loop Faces
  • Spliting Faces At Edges
  • Splitting Non Planar Faces (Basically what heal does)
  • Repairing Face Normals
These steps are performed by internal functions, which are not yet exposed to python API. But we plan to do that in the nearest future. Hopefully in Allpllan 2025, but I cannot guarantee anything here.

Best,
Bart

Hello Sander,

If polyhedron faces are non-planar, Heal tries to fix it - either by moving the vertices a little to make them planar, or by triangulating the faces around the "fixed" vertices. Apparently, this is not the issue with your polyhedron.

The repairing the polyhedron with the UI function "Repair" involves 4 steps:

  • Repairing Cross Loop Faces
  • Spliting Faces At Edges
  • Splitting Non Planar Faces (Basically what heal does)
  • Repairing Face Normals
These steps are performed by internal functions, which are not yet exposed to python API. But we plan to do that in the nearest future. Hopefully in Allpllan 2025, but I cannot guarantee anything here.

Best,
Bart

Thanks for your reply! I will try to find a workaround and keep an eye on the release notes.

http://www.cadblanche.eu


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

Akzeptieren