wassimj / topologicpy

The python bindings for topologic
MIT License
83 stars 23 forks source link

CellComplex.ByCells not working as expected #32

Closed agonzalezesteve closed 1 year ago

agonzalezesteve commented 1 year ago

With a simple test file of a building with 6 Cells: CellComplex.ByCells creates a Cluster with 6 Cells and topologic.CellComplex.ByCells creates a CellComplex with 7 Cells.

image

CellComplex.ByCells should create a CellComplex with 6 Cells. Why CellComplex.ByCells creates a Cluster?

The unexpected Cell is a flat Cell with no volume that corresponds to an interior Face of the CellComplex. Why is this new Cell with no volume appearing?

test_simple_space.zip

wassimj commented 1 year ago

Hi @agonzalezesteve, I'm trying to load your JSON file, but every time I try it, it kills the kernel. Can you send me the 6 cells using breps? and a python script to load them?

agonzalezesteve commented 1 year ago

Here you have.

import_brep.zip

wassimj commented 1 year ago

Both topologicpy and topologic behave exactly the same, returning 7 cells of exactly the same volume and in the same order. I believe this is an issue with how the model is created originally with tolerance where two faces that are supposed to be coplanar are ever so slightly off and creating a a very thin 7th cell.

Adria-Test
wassimj commented 1 year ago

Upon further investigating, I found the culprits. It is only Cell 2 and Cell 3 in the original model that when merged form a CellComplex with 3 Cells. That means that two faces at the corner are not perfectly aligned it seems.

corner
wassimj commented 1 year ago

So the coordinates in the vertices are not clean and are off by a small tolerance. Once I forced the numbers to a certain tolerance (a mantissa of 1), it worked fine.

numbers Laundry
agonzalezesteve commented 1 year ago

Cool, solved! Thanks.

wassimj commented 1 year ago

Glad it was solved.