Giter Club home page Giter Club logo

overlap_checker's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

je-cook

overlap_checker's Issues

maybe support some sort of timeout while checking for overlaps between pairs of individual solids

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

Update ProgressIndicator for compatibility with OCCT >=7.6

When compiling overlap_checker with new OCCT it fails with:
image

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

algo.SetProgressIndicator(*scope_);
everything compiles and as far as I have got works. It looks like some functionality is probably lost by doing that but I havent been able to decipher the above article well enough to put in a PR

Documentation

In the end i figured out how this is meant to work

  1. ./step_to_brep <step_file> <brep_file>
  2. ./overlap_check -j N <brep_file> > overlaps.csv
  3. ./imprint_solids <brep_file> < overlaps.csv

Does that seem correct?

report issues found while running overlap_collector back to user

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!

Error in the output stream

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?

simplify imprinting code

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

support for running on a distributed memory system

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:

step_to_brep

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

overlap_checker

this is currently the most computationally intensive step and (conveniently) the most amenable to parallelism. there are two main operations performed here:

  1. computing an acceleration structure, indicating which shapes can possibly overlap (currently using orientated bounding boxes)
  2. checking every pair of shapes that can overlap to see whether they do, and quantifying any intersections

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

imprint_solids and merge_solids

currently not parallelized, mostly because this functionality isn't heavily used yet and partially due to API limitations in OCCT

report volumes in output of overlap_checker

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

what are degenerated edges and where do they come from?

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.

parallelisation of the merge tool

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.