pythonocc-core
pythonocc-core copied to clipboard
Channel recognition algorithm
Hello all,
First a little bit of background ( about me and the algorithm :) ). I am a Computer Scienece student and I am working on a pythonocc algorithm whose purpose is to identify channels inside a given .STEP file using pythonocc.
In a given compound shape I am scanning all faces and check which faces are likly to be a channel's base. such as marked in figure 1

(Above is Figure 1 )
For each group of faces which assemble a base of a channel (for example all the faces marked in figure 1) I scan for 'walls' of the channel (see in figure 2).

( Above is figure 2 ).
The next step in the algorithm is to check if the faces suspected to be a channel's walls are a closed shape i.e. they surround a channel. ( or are surrounded by the channel if it is the inner walls)
I thougth about creating a plate big enough in the channel's base plane and check for intersection with the suspected channel's walls. -> If the intersection is a closed wire as in figure 2 ( the blue line is an example for an intersection between the walls and the platec (the 'Top plane' in figure 1 or 2) I constructed). else it is an open wire i.e the current base is not a channel's base.
My first question is about the intersection function. I did not understand whether it returns an intersection shape (e.g. intersection of a torrus and a plane is a wire ? not connected edge? ) the purpose is to check if the intersection of the walls with the plate is a close wire, i.e. if it is a closed wall. will the intersection be a closed wire or a different type of entity?
My second question is, Did anyone try to achive such goal and have some advices or any new idea/ contribution ? will be very helpfull.
Thanks upfront. Ron
maybe you can use a bounding box to cut your part, if there is a channel, you suppose to have some 'pip-like' parts.