ukaea / overlap_checker Goto Github PK
View Code? Open in Web Editor NEWA growing collection of tools to process CAD geometries for use in modelling workflows.
License: GNU General Public License v2.0
A growing collection of tools to process CAD geometries for use in modelling workflows.
License: GNU General Public License v2.0
When compiling overlap_checker with new OCCT it fails with:
It seems in OCCT 7.5 there was a bit of a redesign of the progres indicators as described here: https://dev.opencascade.org/content/redesign-progress-indicator
If I comment out this line
overlap_checker/src/geometry.cpp
Line 307 in 0567ec6
might be nice to be able to clean up short edges, inverted normals, etc
I get a tremendous about of chaff following #11 it looks like the CSV stream is going to stdout
1,7e+03,#8FAF8FFF,unknown,0
1047,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Coil#Lower_ELM_Coil;Solid1,7e+03,#8FAF8FFF,unknown,0
1048,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Coil#Lower_ELM_Coil;Solid1,7e+03,#8FAF8FFF,unknown,0
1049,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Coil#Lower_ELM_Coil;Solid1,7e+03,#8FAF8FFF,unknown,0
1050,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Coil#Lower_ELM_Coil;Solid1,7e+03,#8FAF8FFF,unknown,0
1051,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Coil#Lower_ELM_Coil;Solid1,7e+03,#8FAF8FFF,unknown,0
1052,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid9,1e+03,#8FAF8FFF,unknown,0
1053,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid10,1e+03,#8FAF8FFF,unknown,0
1054,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid11,1e+03,#8FAF8FFF,unknown,0
1055,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid12,1e+03,#8FAF8FFF,unknown,0
1056,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid13,1e+03,#8FAF8FFF,unknown,0
1057,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid14,1e+03,#8FAF8FFF,unknown,0
1058,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid15,1e+03,#8FAF8FFF,unknown,0
1059,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid16,1e+03,#8FAF8FFF,unknown,0
1060,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid17,1e+03,#8FAF8FFF,unknown,0
1061,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid18,1e+03,#8FAF8FFF,unknown,0
1062,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid19,1e+03,#8FAF8FFF,unknown,0
1063,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid20,1e+03,#8FAF8FFF,unknown,0
1064,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid21,1e+03,#8FAF8FFF,unknown,0
1065,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid22,1e+03,#8FAF8FFF,unknown,0
1066,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid23,1e+03,#8FAF8FFF,unknown,0
1067,MAST-U_VII_BC_v4.1-meshing_1462-4|Lower_ELM_Brackets#Lower_ELM_Brackets;Solid24,1e+03,#8FAF8FFF,unknown,0
1068,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_upper#NBI_PORTS_upper;Solid2,5e+03,#8F8FAFFF,unknown,0
1069,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_upper#NBI_PORTS_upper;Solid4,2e+02,#8F8FAFFF,unknown,0
1070,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_upper#NBI_PORTS_upper;Solid5,2e+02,#8F8FAFFF,unknown,0
1071,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_upper#NBI_PORTS_upper;Solid6,2e+02,#8F8FAFFF,unknown,0
1072,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_upper#NBI_PORTS_upper;Solid,5e+03,#8F8FAFFF,unknown,0
1073,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_upper_inner#NBI_PORTS_upper_inner;Solid1,1e+04,#AFA48FFF,unknown,0
1074,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid2,4e+03,#8F8FAFFF,unknown,0
1075,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid3,3e+01,#8F8FAFFF,unknown,0
1076,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid4,2e+01,#8F8FAFFF,unknown,0
1077,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid5,2e+01,#8F8FAFFF,unknown,0
1078,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid,2e+02,#8F8FAFFF,unknown,0
1079,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid,4e+02,#8F8FAFFF,unknown,0
1080,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid,2e+02,#8F8FAFFF,unknown,0
1081,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid,5e+01,#8F8FAFFF,unknown,0
1082,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower#NBI_PORTS_lower;Solid,5e+03,#8F8FAFFF,unknown,0
1083,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_PORTS_lower_inner#NBI_PORTS_lower_inner;Solid1,1e+04,#AFA48FFF,unknown,0
1084,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_upper_void_inner#NBI_upper_void_inner;NBI_upper_void_inner,2e+05,#FF80C0FF,unknown,0
1085,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_upper_void_small_bit3#NBI_upper_void_small_bit3;NBI_upper_void_small_bit3,2e+02,#FF80C0FF,unknown,0
1086,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_upper_void_small_bit4#NBI_upper_void_small_bit4;NBI_upper_void_small_bit4,2e+02,#FF80C0FF,unknown,0
1087,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_upper_void_small_bit2#NBI_upper_void_small_bit2;NBI_upper_void_small_bit2,4e+02,#FF80C0FF,unknown,0
1088,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_upper_void_other#NBI_upper_void_other;NBI_upper_void_other,6e+05,#FF80C0FF,unknown,0
1089,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_upper_void_small_bit1#NBI_upper_void_small_bit1;NBI_upper_void_small_bit1,2e+02,#FF80C0FF,unknown,0
1090,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_upper_void_gap#NBI_upper_void_gap;NBI_upper_void_gap,6e+03,#FF80C0FF,unknown,0
1091,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_lower_void_inner#NBI_lower_void_inner;NBI_lower_void_inner,2e+05,#0080FFFF,unknown,0
1092,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_lower_void_other#NBI_lower_void_other;NBI_lower_void_other,9e+05,#0080FFFF,unknown,0
1093,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_lower_void_small_bit2#NBI_lower_void_small_bit2;NBI_lower_void_small_bit2,2e+02,#0080FFFF,unknown,0
1094,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_lower_void_small_bit3#NBI_lower_void_small_bit3;NBI_lower_void_small_bit3,5e+02,#0080FFFF,unknown,0
1095,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_lower_void_small_bit4#NBI_lower_void_small_bit4;NBI_lower_void_small_bit4,2e+02,#0080FFFF,unknown,0
1096,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_lower_void_gap#NBI_lower_void_gap;NBI_lower_void_gap,5e+03,#0080FFFF,unknown,0
1097,MAST-U_VII_BC_v4.1-meshing_1462-4|NBI_lower_void_small_bit1#NBI_lower_void_small_bit1;NBI_lower_void_small_bit1,5e+01,#0080FFFF,unknown,0
1098,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300723#HE08-1 TILE STP-M46300723;Solid1,2e+02,#8D8D8DFF,unknown,0
1099,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300708#HE08-1 TILE STP-M46300708;Solid1,8e+01,#8D8D8DFF,unknown,0
1100,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300702#HE08-1 TILE STP-M46300702;Solid1,2e+02,#8D8D8DFF,unknown,0
1101,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300702#HE08-1 TILE STP-M46300702;Solid2,1e+02,#8D8D8DFF,unknown,0
1102,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300667#HE08-1 TILE STP-M46300667;Solid1,3e+02,#8D8D8DFF,unknown,0
1103,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300667#HE08-1 TILE STP-M46300667;Solid2,3e+02,#8D8D8DFF,unknown,0
1104,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300631#HE08-1 TILE STP-M46300631;Solid1,3e+02,#8D8D8DFF,unknown,0
1105,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300631#HE08-1 TILE STP-M46300631;Solid2,3e+02,#8D8D8DFF,unknown,0
1106,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300706#HE08-1 TILE STP-M46300706;Solid1,2e+02,#8D8D8DFF,unknown,0
1107,MAST-U_VII_BC_v4.1-meshing_1462-4|HE08-1 TILE STP-M46300704#HE08-1 TILE STP-M46300704;Solid1,3e+02,#8D8D8DFF,unknown,0
1108,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-2#HM06 TILE STP-2;Solid,2e+02,#8D8D8DFF,unknown,0
1109,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-3#HM06 TILE STP-3;Solid,3e+02,#8D8D8DFF,unknown,0
1110,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-4#HM06 TILE STP-4;Solid,3e+02,#8D8D8DFF,unknown,0
1111,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-5#HM06 TILE STP-5;Solid,3e+02,#8D8D8DFF,unknown,0
1112,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-6#HM06 TILE STP-6;Solid,2e+02,#8D8D8DFF,unknown,0
1113,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-7#HM06 TILE STP-7;Solid,4e+02,#8D8D8DFF,unknown,0
1114,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-8#HM06 TILE STP-8;Solid,3e+02,#8D8D8DFF,unknown,0
1115,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-9#HM06 TILE STP-9;Solid,2e+02,#8D8D8DFF,unknown,0
1116,MAST-U_VII_BC_v4.1-meshing_1462-4|HM06 TILE STP-1#HM06 TILE STP-1;Solid,2e+02,#8D8D8DFF,unknown,0
1117,MAST-U_VII_BC_v4.1-meshing_1462-4|SAMI_window_port#SAMI_window_port;Solid222222222222,7e+03,#FF8040FF,unknown,0
1118,MAST-U_VII_BC_v4.1-meshing_1462-4|SAMI WINDOW-M46300807#SAMI WINDOW-M46300807;PartBody,1e+04,#AFAF8FFF,unknown,0
1119,MAST-U_VII_BC_v4.1-meshing_1462-4|PROTECTION PLATES-M46300806#PROTECTION PLATES-M46300806;PartBody,1e+03,#AFAF8FFF,unknown,0
1120,MAST-U_VII_BC_v4.1-meshing_1462-4|PROTECTION PLATES-M46300805#PROTECTION PLATES-M46300805;PartBody,1e+03,#AFAF8FFF,unknown,0
1121,MAST-U_VII_BC_v4.1-meshing_1462-4|SAMI_window-void_extension#SAMI_window-void_extension;Solid,2e+05,#8F8FAFFF,unknown,0
61.292 [Info] geometry checks passed
61.292 [Info] enumerated 1121 labels, resulting in 1026 solids
61.292 [Warn] 2 solids were excluded because they were too small
61.292 [Warn] 16 solids were excluded because they had negative volume
I presume this is a bug?
In the end i figured out how this is meant to work
Does that seem correct?
as described by the paper and as implemented by the original PPP
have written some code to pull these out of the logs, but having them nicely in the CSV file would make life easier
three columns, vol_hi
, vol_lo
and vol_shared
would be a good trade off I think
might be worth having vol_shared
blank for touching objects to indicate there isn't any shared volume. this also provides a natural way to distinguish between objects that have an overlap that rounds (for display) to zero and objects that only touch
For example solid 19 from Helen's step
file basically disappears and it would be good to know why. For example is it a problem with the input geometry or something to do with how I'm using OCCT.
still need to figure out what would be good examples
not sure what I was thinking when I wrote it, it's far more complicated than it needs to be!
while writing the ARCHITECTURE
document realized it only needs to do a single CUT
operation with the shape being the smaller solid and the tool being the larger one
hopefully this will result in simpler geometry being written out at the end, which will make the mesher's job easier as well
might be nice to separate out unit vs regression test result, but not sure if it's important
if the operation failed, we should be reporting warnings and errors back as these probably indicate an issue with the input geometry that could turn out to be useful to the user
Helen's step
file using broken sectioning code causes some internal errors to get set, which might be nice for testing!
As part of #10, I've pulled out the relevant parts of Salome. The aim is to be able to glue geometries consisting of 100k+ solids, but the algorithm is currently serial and would grind to a halt on problems of this size.
The Salome code lives in src/salome/geom_gluer.cpp
and I've started to refactor the code into a more understandable form. The majority of time is spent within the shape_merger::RefineCoincidentShapes
method, as shown by the timings in the logging output. I'm currently working on getting a reproducible set of tests with an easy way of getting "known good" output from the original Salome code for regression tests for validating changes.
Note that "lists" in opencascade (OCC) are linked lists, so locality is likely not great when traversing a lot of these structures. Might be worth using some data structures from outside OCC.
SALOME's shape gluer code has various branches that are never tested because they are behind if(BRep_Tool::Degenerated(edge))
tests that never come up true. The docs aren't particularly here, currently documenting this function as:
Returns True if the edge is degenerated.
Would be good to figure out how to generate a geometry that has solids containing degenerated edges and know what the "right thing" to do when gluing shapes in the presence of them.
i.e. can this tool efficiently utilize a cluster of machines (communicating over a network via something like MPI) when checking a "large" geometry. @makeclean I heard you're thinking about this
I should note that a number of existing choices have been made assuming this was a direction to be taken, and it's worth describing what these are:
loading a STEP file with OCCT, given the current implementation, is relatively slow and all-or-nothing, while BREP files are much faster. e.g. a 200MiB STEP file takes ~2 minutes to open, writing the same geometry (~5000 solids) out as BREP takes ~7 seconds, and loading that BREP file ~3 seconds.
this step already flattens the shapes into a linear list because this structure is easier to schedule operations on than the hierarchy used by STEP. additionally, it might be worth splitting up a large input file into multiple flattened BREP files, either a range (e.g. solids 1000 to 2000) of a large STEP file, which would hopefully allow larger files to be checked by smaller-memory nodes
this is currently the most computationally intensive step and (conveniently) the most amenable to parallelism. there are two main operations performed here:
both of these steps are currently parallelized over threads, but it's possible to also split this across nodes. given the speed of loading BREP files, it might even be worth performing this separately multiple times in a NUMA system to ensure that each socket has fast/local access to the geometry
currently not parallelized, mostly because this functionality isn't heavily used yet and partially due to API limitations in OCCT
OCCT can take a long time to check for overlaps between some solids, e.g. minutes.
the observed behavior is that the overlap_checker
will run for a long time, with only a single thread active at the end. this is because all other pairs have been processed, and it's just waiting on a single errant pair for the program to stop. I can't decide if we should just wait, but there are so many times when I see this that it seems worth while looking into.
I think I might be able to use Message_ProgressIndicator::UserBreak()
to do this cleanly (set via BOPAlgo_Options::SetProgressIndicator()
) to report (for human checking in a CAD package). stopping pairwise checks that take "too long" (e.g. 5 minutes) would be useful for batch checking many files
e.g. my script for checking all of Colin's files aborts if the overlap checking program runs for more than 10 minutes, but for large files this might be wrong as it could still be making useful progress
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.