MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0032182Open CASCADE[OCCT] OCCT:Visualizationpublic2021-03-01 10:122021-04-06 13:29
Reporterkgv 
Assigned Tokgv 
PrioritynormalSeverityfeature 
StatusresolvedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0032182: Visualization - add Select3D_SensitiveSphere
DescriptionIt is proposed implementing Select3D_SensitiveSphere class performing an analytical intersection with an untriangulated sphere defined by it's center and radius.

It will be necessary implementing interfaces for ray/sphere, frustum/sphere and overlapped/nonoverlapped intersection methods (AIS_InteractiveContext::SelectPoint()/SelectRectangle()/SelectPolygon() and SelectMgr_ViewerSelector::AllowOverlapDetection()) - to be covered by new tests.

As a first step, testing could be done by an auxiliary Interactive Object in ViewerTest package - automatic detection of simple sphere geometry within StdSelect::StdSelect_BRepSelectionTool could be considered as next step.
Steps To Reproduce
pload MODELING VISUALIZATION

vinit View1 w=1024 h=1024
vclear
# parameter NB defines number of spheres by each coordinate
set NB 10
puts "Creating [expr $NB * $NB * $NB] spheres..."
for {set i 0} {$i < $NB} {incr i} {
  for {set j 0} {$j < $NB} {incr j} {
    for {set k 0} {$k < $NB} {incr k} {
      psphere s$i$j$k 1.
      ttranslate s$i$j$k 3.*$i 3.*$j 3.*$k
      vdisplay -dispMode 1 s$i$j$k 
    }
  }
}
vfit
dchrono cpu restart
vmoveto 512 554
vselect 15 15 1020 1020
vtop
vselect 31 113 730 113 730 816 31 816
vselect 67 134 128 194
vaxo
vmoveto 96 675
vmoveto 176 675
vmoveto 287 675
vmoveto 372 675
vmoveto 454 675
vmoveto 553 675
vmoveto 646 675
vmoveto 734 675
vmoveto 814 675
vmoveto 921 675
dchrono cpu stop counter moveTo

Additional information
and documentation updates
According to the results of comparing the performance of the new spherical class
The time spent building a BVH tree to triangulate each sphere was significantly reduced.
Elapsed Time: From 2 minutes 21 seconds to 0.655 seconds (2052.7% speed increase)
CPU user time: From 140.27 seconds to 0.484 seconds (2800% speed increase)

The time taken to intersect with thousands of spheres when detected by the beam also dropped.
Elapsed Time: From 1.55 seconds to 0.448 seconds (246% speed increase)
CPU user time: From 1.25 seconds to 0.146 seconds (756% speed increase)

Performance test scenario:
pload MODELING VISUALIZATION
vinit View1
vdefaults -autoTriang 0
set nb 5000
set lst {}
for {set i 0} {$i < $nb} {incr i} { psphere s$i 1; lappend lst s$i }
for {set i 0} {$i < $nb} {incr i} { ttranslate s$i 0 0 $i }
compound {*}$lst c
incmesh c 0.008
for {set i 0} {$i < $nb} {incr i} { vdisplay -dispMode 1 s$i -noupdate }
vtop
vfit
# delayed BVH building
dchrono t reset; dchrono t start
vmoveto 200 200
dchrono t stop;  dchrono t show
dchrono t reset; dchrono t start
# single pick time (with precomputed BVH)
vmoveto 0 0
vmoveto 200 200
dchrono t stop;  dchrono t show

TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0031773closedmzernova Visualization - add Prs3d_ToolTorus 
related to 0032281newmkrylova Visualization - add Select3D_SensitiveCylinder 
related to 0032183assignedmkrylova Visualization - implement AIS_LightSource::ProcessDragging() for rotating directional light 

-  Notes
(0099658)
mkrylova (developer)
2021-03-22 17:39

Branch CR32182 has been created by mkrylova.

Author: mkrylova
Date: Mon Mar 22

    0032182: Visualization - add Select3D_SensitiveSphere

    - created Select3D_SensitiveSphere class
    - implemented interfaces for intersection methods
    - added tests
(0099693)
git (administrator)
2021-03-23 22:39

Branch CR32182 has been created by kgv.

SHA-1: 1366e0927b6e52e97b5c22a824e2d96173ef8865


Detailed log of new commits:

Author: mkrylova
Date: Wed Mar 17 17:38:00 2021 +0300

    0032182: Visualization - add Select3D_SensitiveSphere
    
    - created Select3D_SensitiveSphere class
    - implemented interfaces for intersection methods
    - added tests
(0099713)
git (administrator)
2021-03-24 14:18

Branch CR32182 has been updated by mkrylova.

SHA-1: 3351e634f3da60abf334c1484f798a7e0aa15b26


Detailed log of new commits:

Author: mkrylova
Date: Tue Mar 23 17:05:29 2021 +0300

    # kgv remarks
    - fixed code style
    - added test to check the depth

(0099714)
git (administrator)
2021-03-24 14:20

Branch CR32182_1 has been created by mkrylova.

SHA-1: 9e61fb474e5288bea8207fe11c9cfff9fc7bcb97


Detailed log of new commits:

Author: mkrylova
Date: Wed Mar 17 17:38:00 2021 +0300

    0032182: Visualization - add Select3D_SensitiveSphere
    
    - created Select3D_SensitiveSphere class
    - implemented interfaces for intersection methods
    - added tests
(0099754)
kgv (developer)
2021-03-26 06:57

Failing test cases (to be updated or analyzed): v3d bugs bug24606,bug25935
(0099803)
git (administrator)
2021-03-29 10:03

Branch CR32182_2 has been updated forcibly by kgv.

SHA-1: 6332f6b3c25ec294bcec8c53c52b43d7a511b6ac
(0099902)
git (administrator)
2021-03-31 12:36

Branch CR32182_2 has been updated by mkrylova.

SHA-1: 21e5a3d91d68a283de49ccbac97471bda51b182e


Detailed log of new commits:

Author: mkrylova
Date: Tue Mar 30 17:39:22 2021 +0300

    # kgv remarks
    - fixed tests
    - fixed depth calculation

(0099903)
git (administrator)
2021-03-31 12:43

Branch CR32182_3 has been created by mkrylova.

SHA-1: f6a44b4a0dde5c0698962ab6e720fd639f8ba29b


Detailed log of new commits:

Author: mkrylova
Date: Wed Mar 17 17:38:00 2021 +0300

    0032182: Visualization - add Select3D_SensitiveSphere
    
    - created Select3D_SensitiveSphere class
    - implemented interfaces for intersection methods
    - added tests
(0099904)
git (administrator)
2021-03-31 13:40

Branch CR32182_3 has been updated by mkrylova.

SHA-1: 14693e9f449c4ba94f79530ee0c876b86b7a61b1


Detailed log of new commits:

Author: mkrylova
Date: Wed Mar 31 13:42:39 2021 +0300

    # add checking for a negative value

(0099905)
git (administrator)
2021-03-31 13:45

Branch CR32182_4 has been created by mkrylova.

SHA-1: 0e347d20030da99d4b391225bd93eb3f9603aa67


Detailed log of new commits:

Author: mkrylova
Date: Wed Mar 17 17:38:00 2021 +0300

    0032182: Visualization - add Select3D_SensitiveSphere
    
    - created Select3D_SensitiveSphere class
    - implemented interfaces for intersection methods
    - added tests
(0099964)
git (administrator)
2021-04-01 19:06

Branch CR32182_4 has been updated by mkrylova.

SHA-1: c0ad5b887c007edaee9979c3c3733f040cbb66ea


Detailed log of new commits:

Author: mkrylova
Date: Thu Apr 1 19:09:04 2021 +0300

    # fixed depth scale

(0099966)
git (administrator)
2021-04-01 19:13

Branch CR32182_5 has been created by mkrylova.

SHA-1: f90112bb9e7dbc32be41533572d3d3c26ac56fdc


Detailed log of new commits:

Author: mkrylova
Date: Wed Mar 17 17:38:00 2021 +0300

    0032182: Visualization - add Select3D_SensitiveSphere
    
    - created Select3D_SensitiveSphere class
    - implemented interfaces for intersection methods
    - added tests

- Issue History
Date Modified Username Field Change
2021-03-01 10:12 kgv New Issue
2021-03-01 10:12 kgv Assigned To => mkrylova
2021-03-01 10:16 kgv Relationship added related to 0031773
2021-03-01 10:22 kgv Relationship added related to 0032183
2021-03-01 10:23 kgv Status new => assigned
2021-03-22 17:39 mkrylova Note Added: 0099658
2021-03-22 17:39 mkrylova Assigned To mkrylova => kgv
2021-03-22 17:39 mkrylova Status assigned => resolved
2021-03-22 17:39 mkrylova Steps to Reproduce Updated View Revisions
2021-03-22 18:14 kgv Assigned To kgv => mkrylova
2021-03-22 18:14 kgv Status resolved => assigned
2021-03-23 22:39 git Note Added: 0099693
2021-03-24 14:18 git Note Added: 0099713
2021-03-24 14:20 git Note Added: 0099714
2021-03-24 14:22 mkrylova Assigned To mkrylova => kgv
2021-03-24 14:22 mkrylova Status assigned => resolved
2021-03-24 14:22 mkrylova Steps to Reproduce Updated View Revisions
2021-03-24 18:51 kgv Assigned To kgv => mkrylova
2021-03-24 18:51 kgv Status resolved => assigned
2021-03-24 18:51 kgv Steps to Reproduce Updated View Revisions
2021-03-26 06:57 kgv Note Added: 0099754
2021-03-29 10:03 git Note Added: 0099803
2021-03-31 12:36 git Note Added: 0099902
2021-03-31 12:43 git Note Added: 0099903
2021-03-31 12:50 mkrylova Assigned To mkrylova => kgv
2021-03-31 12:50 mkrylova Status assigned => resolved
2021-03-31 13:16 mkrylova Assigned To kgv => mkrylova
2021-03-31 13:16 mkrylova Status resolved => assigned
2021-03-31 13:40 git Note Added: 0099904
2021-03-31 13:45 git Note Added: 0099905
2021-03-31 13:54 mkrylova Assigned To mkrylova => kgv
2021-03-31 13:54 mkrylova Status assigned => resolved
2021-04-01 19:06 git Note Added: 0099964
2021-04-01 19:13 git Note Added: 0099966
2021-04-05 09:50 kgv Relationship added related to 0032281
2021-04-06 13:26 mkrylova Additional Information Updated View Revisions
2021-04-06 13:29 kgv Additional Information Updated View Revisions


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker