mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
Ray tracing activated in bottle sample if available; test bugs vis bug21753 added
This commit is contained in:
parent
1238134135
commit
821edd22a9
@ -2,7 +2,7 @@
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
|
||||
# Construct bottle body
|
||||
puts "Constructing bottle body..."
|
||||
|
||||
# set basic dimensions
|
||||
dset height 70
|
||||
@ -53,7 +53,7 @@ bfuse f b c
|
||||
explode c f
|
||||
offsetshape body f -thickness/50 1.e-3 c_2
|
||||
|
||||
# Construct threading
|
||||
puts "Constructing threading..."
|
||||
|
||||
# make two cylinders
|
||||
cylinder c1 0 0 height 0 0 1 neckradius*0.99
|
||||
@ -91,8 +91,10 @@ mkedgecurve tw2 1.e-5
|
||||
# build threading as solid
|
||||
thrusections -N thread 1 0 tw1 tw2
|
||||
|
||||
puts "Putting together and writing \"Open CASCADE\"..."
|
||||
|
||||
# add threading to the body
|
||||
compound body thread bottle1
|
||||
compound body thread bottle
|
||||
|
||||
# define text
|
||||
text2brep text2d OpenCASCADE Times-Roman 8 bold composite=0
|
||||
@ -101,9 +103,21 @@ trotate text 0 0 0 0 1 0 90
|
||||
ttranslate text 24.75 -2 65
|
||||
|
||||
# cut operation
|
||||
bcut bottle bottle1 text
|
||||
bcut bodytext body text
|
||||
compound bodytext thread bottle
|
||||
|
||||
puts "Showing result..."
|
||||
|
||||
# display result
|
||||
vdisplay bottle
|
||||
vfit
|
||||
vsetdispmode 1
|
||||
|
||||
# set ray tracing
|
||||
if { [regexp {HAVE_OPENCL} [dversion]] } {
|
||||
puts "Trying raytrace mode..."
|
||||
if { ! [catch {vraytrace 1}] } {
|
||||
vtextureenv on 1
|
||||
vfit
|
||||
}
|
||||
}
|
27
tests/bugs/vis/bug21753
Normal file
27
tests/bugs/vis/bug21753
Normal file
@ -0,0 +1,27 @@
|
||||
puts "==========="
|
||||
puts "OCC21753"
|
||||
puts "==========="
|
||||
puts "=================================="
|
||||
puts "Poor display of shading on cones due to Gouraud shading limitations"
|
||||
puts "=================================="
|
||||
|
||||
# set rough meshing parameters
|
||||
vinit
|
||||
vdefaults absDefl=10 devCoeff=0.1
|
||||
|
||||
puts "Displaying two equal cones, one with Phong shader"
|
||||
pcone p_gouraud 10 100 100
|
||||
trotate p_gouraud 0 0 0 0 1 0 -90
|
||||
vdisplay p_gouraud
|
||||
vsetdispmode p_gouraud 1
|
||||
#vsetmaterial p_gouraud bronze
|
||||
|
||||
tcopy p_gouraud p_phong
|
||||
ttranslate p_phong 200 0 0
|
||||
vdisplay p_phong
|
||||
vsetdispmode p_phong 1
|
||||
#vsetmaterial p_phong bronze
|
||||
vshaderprog p_phong phong
|
||||
|
||||
vfit
|
||||
set only_screen 1
|
Loading…
x
Reference in New Issue
Block a user