Page 1 of 1

Problem with intersection

Posted: Mon Aug 24, 2020 3:29 pm
by AlejandroMaximus
I am having some problems with the intersection function. I am programming a TCl script that uses the intersect function. Unfortunately the intersect function is not very reliable. Sometimes after intersecting the two volumes involved are simply gone. This case is however easy to intercept by checking the number of volumes present in the layers involved, slightly changing one of the volumes and repeating the intersection until it works. Just recently, however, another error occured. After intersecting an info window pops up saying: "Volume not closed, surfaces: xxx, xxx". I also want to intercept this error in my tcl script and somehow need a return value from the intersect function I can use.

Thanks for your help,

Re: Problem with intersection

Posted: Tue Sep 01, 2020 8:41 pm
by escolano
You are right,
the boolean operations, and the intersection are not robust operations in GiD.
Must solve problems of intersection curve-curve, curve-surface, surface-surface, and alle these operations involve solve non-linear systems,
with multiple or zero solutions, and become not very reliable. It depends a lot of tolerances.

It is difficult to handle possible errors, only in particular cases you can check the ids of new entities, ids are always increasing.
Can know before for example the maximum pointid with
set max_point_id [GiD_Info geometry MaxNumPoints]
and check the new ids after an operation
e.g. with
GiD_Geometry list point

Re: Problem with intersection

Posted: Sun May 22, 2022 2:51 am
by IuryCoimbra
Hi guys,
I need some help, please.
How can I start a macro in a batch file? I created a macro to calculate the surface intersections between two 3D objects, however it only works in the GiD GUI (with mouse clicks) and I need to run it many times (via batch file).

Could anyone help me with this?

My code is below, if anyone wants to make adjustments, I'll gladly accept! :mrgreen:

#
proc ::toolbarmacros::macrospace::Macro1 {} {
\\\\\for {set k 0} {$k < 75} {incr k} { #
\\\\\\\\\\set vetSurfCage [GiD_Geometry list -layer Layer0 surface]
\\\\\\\\\\set vetSurfaceConduit [GiD_Geometry list -layer Layer1 surface]
\\\\\\\\\\set lenCage [llength $vetSurfCage]
\\\\\\\\\\set lenConduit [llength $vetSurfaceConduit]
\\\\\\\\\\for {set i 0} {$i < $lenCage} {incr i} {
\\\\\\\\\\\\\\\for {set j 0} {$j < $lenConduit} {incr j} {
\\\\\\\\\\\\\\\\\\\\GiD_Process MEscape Geometry Create IntMultSurfs [lindex $vetSurfCage $i] [lindex $vetSurfaceConduit $j] escape
\\\\\\\\\\\\\\\\\\\\set vetSurfaceConduitNew [GiD_Geometry list -layer Layer0 surface]
\\\\\\\\\\\\\\\\\\\\set lenConduitNew [llength $vetSurfaceConduitNew]
\\\\\\\\\\\\\\\\\\\\if {$lenConduit < $lenConduitNew} {
\\\\\\\\\\\\\\\\\\\\\\\\\ break
\\\\\\\\\\\\\\\\\\\\ }
\\\\\\\\\\\\\\\}
\\\\\\\\\\}
\\\\\\\\\\GiD_Process Mescape Utilities Renumber escape
\\\\\}
}

Re: Problem with intersection

Posted: Mon May 23, 2022 10:10 am
by escolano
In a GiD batch file you can invoke Tcl code starting the line with *****TCL
e.g.
*****TCL ::toolbarmacros::macrospace::Macro1