mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-10 09:30:48 +08:00
1. New testgrid "lowalgos/intss" has been created. It will contain all test cases on geometrical intersection of two surfaces ("intersect" DRAW-command) and two faces ("bopcurves" DRAW-command).
2. New test case for the issue #28493 has been created because the problem is not reproduced on MASTER.
3. Test case (lowalgos/intss/bug24472) for the issue #29501 has been modified in order to check loops of the resulting intersection curves.
31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
# Checks whether theCurve has a loop/bend
|
|
# Use: CheckLoops curve CosMaxAngle [theNbPoints]}
|
|
# theNbPoints sets the interval of discretization;
|
|
# theCosMaxAngle sets the maximal rotation angle between two adjacent segments. This value must be equal to the cosine of this angle.
|
|
|
|
help CheckLoops {curve CosMaxAngle theNbPoints }
|
|
proc CheckLoops {theCurve theCosMaxAngle {theNbPoints 1000.0}} {
|
|
upvar #0 $theCurve aCurve
|
|
bounds aCurve U1 U2
|
|
|
|
set delta [dval (U2-U1)/$theNbPoints]
|
|
cvalue aCurve [dval U1] xp yp zp dx1 dy1 dz1
|
|
|
|
for {set p [dval U1]} {$p <= [dval U2]} {set p [expr $p + $delta]} {
|
|
cvalue aCurve $p xp yp zp dx2 dy2 dz2
|
|
|
|
#Check if the angle between the vectors {dx1 dy1 dz1} and {dx2 dy2 dz2} is less than 30deg.
|
|
set nv1 [ dval dx1*dx1+dy1*dy1+dz1*dz1 ]
|
|
set nv2 [ dval dx2*dx2+dy2*dy2+dz2*dz2 ]
|
|
set dp [ dval dx1*dx2+dy2*dy2+dz1*dz2 ]
|
|
|
|
if {$dp < [ expr $theCosMaxAngle * sqrt($nv1 * $nv2) ] } {
|
|
puts "Error: The curve aCurve is possible to have a bend at parameter $p. Please check carefully"
|
|
}
|
|
|
|
dset dx1 dx2
|
|
dset dy1 dy2
|
|
dset dz1 dz2
|
|
}
|
|
}
|