Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounding volume computation improvements #79

Merged
merged 7 commits into from
Nov 9, 2023

Conversation

javagl
Copy link
Contributor

@javagl javagl commented Oct 29, 2023

Addresses #58 and #69 (and may eventually fix them).

(It builds on #75 , so that should be merged first, but there is not much "overlap", so the changes here could also be retargeted to another branch)

The createTilesetJson function takes a set of tile content files, and creates a tileset JSON file from them. Thus usually boiled down to computing the bounding box of a GLB, and eventually, creating an axis-aligned bounding box. As pointed out in #47 (comment) , this will usually not yield a very tight bounding volume.

The merge function receives multiple tilesets, and creates a single tileset from them - basically by creating a new tileset where the root node refers to the root node of the other tileset as its children. As mentioned in #69 (comment) , this used some "legacy" functionality which created bounding spheres for the result.

This PR adds a few new functions, mostly in the BoundingVolumes class (and corresponding updates in the TilesetJsonCreator and TilesetMerger) for better bounding volume computations. The summary is, roughly:

  • Compute bounding volumes of tile content (GLB) not by using the axis-aligned bounding box of the GLB, but by computing an oriented bounding box from the vertices inside the GLB
  • Generally: Prefer (oriented) bounding boxes when computing bounding volumes for "parent" tiles from "child" tiles (in the TilesetJsonCreator and TilesetMerger). This basically means:
    • compute the oriented bounding boxes of the children
    • compute the union of these bounding boxes, by transforming the corners of the bounding boxes, and computing a new oriented bounding box from these transformed corners

Applied to the content that was provided by @sweco-sekrsv in #47 , this will yield better results;

Cesium Tools BV 01

The (single) test case for the merge operation does no longer create a bounding sphere:

Cesium Tools BV 02

The test cases for createTilesetJson generally yield tighter bounding volumes:

Cesium Tools BV 03

(There is not much difference for the point clouds, and one could expect better ones to be computed there - this still has to be reviewed...)

Base automatically changed from maintenance-2023-10 to main October 30, 2023 14:41
@javagl
Copy link
Contributor Author

javagl commented Nov 7, 2023

I did examine the computation of the oriented bounding boxes (for point clouds, and in general) a bit more. The reason for the bounding boxes not being very tight is that the current OrientedBoundingBox::fromPoints method of CesiumJS uses an approach that often does not yield "good" bounding volumes. Some details are tracked in CesiumGS/cesium#11600

In the last commit, I replaced this function with one that computes the oriented bounding boxes using https://github.com/Esri/dito.ts

For a test, I generated 5x5x5 "point clouds" with varying numbers of points (200....25000), randomly distributed within boxes, with different sizes and orientations. For each of them, I computed the OBB once with CesiumJS and once with dito.ts, measured the computation time and the volume of the box.

The computation with dito.ts is noticably slower (very roughly by a factor of 6), but in nearly all cases, the bounding volumes are smaller (sometimes by a factor of nearly 3).

The proof is in the pudding: Here's a visualization of the results:

Cesium OBB CvsD

(the data is attached below).

Overall, I think that it makes sense to use this function for the computation of the bounding volumes when creating a tileset JSON. The computation is not really "time-critical" in this case. And "bad bounding volumes" can lead to "bad runtime behavior".

What remains to be done here:

  • remove the CesiumJS-based implementation (right now, both implementations are present, for the comparisons)
  • update the 'golden' files for the tileset JSON creation

The data (all GLBs with two tileset JSON files) is here:

orientedBoundingBoxComparison-2023-11-07.zip

Timing results:

For 200 points at 0-0-0
  CesiumJS 1.7849000003188848 ms, volume 0.00025631986731996115
  dito.ts  3.988299999386072 ms, volume 0.00011860421895834244 
For 400 points at 0-0-1
  CesiumJS 0.7707999981939793 ms, volume 0.001091667973344777  
  dito.ts  2.4677000008523464 ms, volume 0.0007760117616190102
For 600 points at 0-0-2
  CesiumJS 1.1302000004798174 ms, volume 0.0018599881449393404
  dito.ts  1.3223999999463558 ms, volume 0.001686348127577181 
For 800 points at 0-0-3
  CesiumJS 0.8593999985605478 ms, volume 0.0021486176847906498
  dito.ts  1.3394999988377094 ms, volume 0.0024481111856691756
For 1000 points at 0-0-4
  CesiumJS 0.9383999984711409 ms, volume 0.003950047075076485
  dito.ts  1.7130999993532896 ms, volume 0.002490043506011135
For 400 points at 0-1-0
  CesiumJS 0.510300001129508 ms, volume 0.0010994174143182647
  dito.ts  0.6597000006586313 ms, volume 0.0007990730926785314
For 800 points at 0-1-1
  CesiumJS 0.5157999992370605 ms, volume 0.007337809743275127
  dito.ts  0.8875999990850687 ms, volume 0.006458326037082433
For 1200 points at 0-1-2
  CesiumJS 0.4567999988794327 ms, volume 0.007998226312486546
  dito.ts  1.257200000807643 ms, volume 0.011938922355720643
For 1600 points at 0-1-3
  CesiumJS 0.9027999993413687 ms, volume 0.011227918401859667
  dito.ts  2.5981000009924173 ms, volume 0.013900447936421246
For 2000 points at 0-1-4
  CesiumJS 0.7463000006973743 ms, volume 0.014785073834015533
  dito.ts  2.0618000011891127 ms, volume 0.018520309534013263
For 600 points at 0-2-0
  CesiumJS 0.24249999970197678 ms, volume 0.002211841325395752
  dito.ts  1.5885000005364418 ms, volume 0.0019421134002904682
For 1200 points at 0-2-1
  CesiumJS 0.3129999991506338 ms, volume 0.0079104711098229
  dito.ts  4.921299999579787 ms, volume 0.009232797399172432
For 1800 points at 0-2-2
  CesiumJS 0.47610000148415565 ms, volume 0.02610715329318813
  dito.ts  2.2686000000685453 ms, volume 0.01772450549314975
For 2400 points at 0-2-3
  CesiumJS 0.4258999992161989 ms, volume 0.021087900657661057
  dito.ts  2.740600001066923 ms, volume 0.025720089566929318
For 3000 points at 0-2-4
  CesiumJS 0.4801000002771616 ms, volume 0.027582333244653763
  dito.ts  2.768199998885393 ms, volume 0.03378544084412176
For 800 points at 0-3-0
  CesiumJS 0.19580000080168247 ms, volume 0.0034252934923782842
  dito.ts  0.7618999984115362 ms, volume 0.003348825779563214
For 1600 points at 0-3-1
  CesiumJS 0.3108000010251999 ms, volume 0.011290148482370872
  dito.ts  1.3389999996870756 ms, volume 0.014010132789333057
For 2400 points at 0-3-2
  CesiumJS 0.4096999987959862 ms, volume 0.021251449106135988
  dito.ts  1.8178000003099442 ms, volume 0.025830026940857724
For 3200 points at 0-3-3
  CesiumJS 0.5614999998360872 ms, volume 0.056967627753629714
  dito.ts  2.432600000873208 ms, volume 0.03748571024710371
For 4000 points at 0-3-4
  CesiumJS 0.6225999984890223 ms, volume 0.039455751307175026
  dito.ts  3.083499999716878 ms, volume 0.04910279175307495
For 1000 points at 0-4-0
  CesiumJS 0.30640000104904175 ms, volume 0.004537312291761463
  dito.ts  0.9017000012099743 ms, volume 0.002490043617461631
For 2000 points at 0-4-1
  CesiumJS 0.36460000090301037 ms, volume 0.014896122264326753
  dito.ts  1.5436000004410744 ms, volume 0.015942761818098332
For 3000 points at 0-4-2
  CesiumJS 0.44759999960660934 ms, volume 0.027756797888441733
  dito.ts  2.292100001126528 ms, volume 0.03412457260802722
For 4000 points at 0-4-3
  CesiumJS 0.6062000002712011 ms, volume 0.03972215991338349
  dito.ts  3.085200000554323 ms, volume 0.049275426475264575
For 5000 points at 0-4-4
  CesiumJS 0.6783000007271767 ms, volume 0.08144146623624991
  dito.ts  3.567500000819564 ms, volume 0.058918842640727866
For 400 points at 1-0-0
  CesiumJS 0.13339999876916409 ms, volume 0.0009805399332620385
  dito.ts  0.38760000094771385 ms, volume 0.0008196412029054563
For 800 points at 1-0-1
  CesiumJS 0.16980000026524067 ms, volume 0.007682807292427216
  dito.ts  0.6816000007092953 ms, volume 0.004237272855748191
For 1200 points at 1-0-2
  CesiumJS 0.227700000628829 ms, volume 0.007968601442600826
  dito.ts  0.9375 ms, volume 0.007946646072934853
For 1600 points at 1-0-3
  CesiumJS 0.30979999899864197 ms, volume 0.011317770504217242
  dito.ts  1.2021000012755394 ms, volume 0.0115983893055555
For 2000 points at 1-0-4
  CesiumJS 0.5023999996483326 ms, volume 0.014876886334384918
  dito.ts  1.4672999996691942 ms, volume 0.022636079402072476
For 800 points at 1-1-0
  CesiumJS 0.23570000007748604 ms, volume 0.005184694189874017
  dito.ts  0.6602999996393919 ms, volume 0.005812044568787861
For 1600 points at 1-1-1
  CesiumJS 0.2919999994337559 ms, volume 0.061333877527650814
  dito.ts  1.5449000000953674 ms, volume 0.02831359400664443
For 2400 points at 1-1-2
  CesiumJS 0.37060000002384186 ms, volume 0.06021050655200125
  dito.ts  1.8212999999523163 ms, volume 0.04875284398861387
For 3200 points at 1-1-3
  CesiumJS 0.44879999943077564 ms, volume 0.09270709376000186
  dito.ts  2.359899999573827 ms, volume 0.07034627632010322
For 4000 points at 1-1-4
  CesiumJS 0.6219000015407801 ms, volume 0.1437506333613584
  dito.ts  3.0372999999672174 ms, volume 0.10109129091278969
For 1200 points at 1-2-0
  CesiumJS 0.22409999929368496 ms, volume 0.008034614276211018
  dito.ts  0.9788999985903502 ms, volume 0.00991715664305726
For 2400 points at 1-2-1
  CesiumJS 0.3643999993801117 ms, volume 0.08155528958953964
  dito.ts  1.819700000807643 ms, volume 0.050905108842937793
For 3600 points at 1-2-2
  CesiumJS 0.5561999995261431 ms, volume 0.1520997147448322
  dito.ts  3.9322999995201826 ms, volume 0.10583033788590167
For 4800 points at 1-2-3
  CesiumJS 0.6754000000655651 ms, volume 0.1193952233571752
  dito.ts  3.5791999995708466 ms, volume 0.12261677390939377
For 6000 points at 1-2-4
  CesiumJS 0.8236999996006489 ms, volume 0.1564052126307387
  dito.ts  4.576199999079108 ms, volume 0.23344311162284348
For 1600 points at 1-3-0
  CesiumJS 0.2694000005722046 ms, volume 0.011302407731283234
  dito.ts  1.3065000008791685 ms, volume 0.014272064379026936
For 3200 points at 1-3-1
  CesiumJS 0.5266999993473291 ms, volume 0.11987444747992124
  dito.ts  2.4915999993681908 ms, volume 0.06774670230625811
For 4800 points at 1-3-2
  CesiumJS 0.8574000000953674 ms, volume 0.12085627534359161
  dito.ts  3.3966000005602837 ms, volume 0.13034415614185973
For 6400 points at 1-3-3
  CesiumJS 0.8795999996364117 ms, volume 0.3312466296285687
  dito.ts  5.036000000312924 ms, volume 0.22838459922064663
For 8000 points at 1-3-4
  CesiumJS 1.059399999678135 ms, volume 0.22251671710107007
  dito.ts  5.824599999934435 ms, volume 0.2396992614576861
For 2000 points at 1-4-0
  CesiumJS 0.28680000081658363 ms, volume 0.01486747223724972
  dito.ts  2.5716000013053417 ms, volume 0.02385181248218675
For 4000 points at 1-4-1
  CesiumJS 0.5315000005066395 ms, volume 0.15788899889518332
  dito.ts  3.1631999984383583 ms, volume 0.0886118234988914
For 6000 points at 1-4-2
  CesiumJS 0.7800000011920929 ms, volume 0.15861412610094971
  dito.ts  4.757199998944998 ms, volume 0.23062705416929136
For 8000 points at 1-4-3
  CesiumJS 1.2454000003635883 ms, volume 0.22319854020262286
  dito.ts  5.907199999317527 ms, volume 0.29739860135184726
For 10000 points at 1-4-4
  CesiumJS 1.3367999996989965 ms, volume 0.570928345079293
  dito.ts  7.768800001591444 ms, volume 0.3855956475582101
For 600 points at 2-0-0
  CesiumJS 0.14289999939501286 ms, volume 0.002035527646780143
  dito.ts  0.5704000014811754 ms, volume 0.0021135517404228333
For 1200 points at 2-0-1
  CesiumJS 0.20100000128149986 ms, volume 0.008009073634444057
  dito.ts  0.9712000004947186 ms, volume 0.007998900391688534
For 1800 points at 2-0-2
  CesiumJS 0.2796000000089407 ms, volume 0.02641207968402324
  dito.ts  1.3897999990731478 ms, volume 0.014587866711502076
For 2400 points at 2-0-3
  CesiumJS 0.37150000035762787 ms, volume 0.02188317255451752
  dito.ts  1.9403000008314848 ms, volume 0.02739371882451419
For 3000 points at 2-0-4
  CesiumJS 0.4249000009149313 ms, volume 0.027921892070966504
  dito.ts  2.2970000002533197 ms, volume 0.03588511240880299
For 1200 points at 2-1-0
  CesiumJS 0.2592000011354685 ms, volume 0.008025582801763546
  dito.ts  1.0592999998480082 ms, volume 0.009801111556284398
For 2400 points at 2-1-1
  CesiumJS 0.4024999998509884 ms, volume 0.08247207054256184
  dito.ts  1.8775999993085861 ms, volume 0.04601718892910706
For 3600 points at 2-1-2
  CesiumJS 0.5336000006645918 ms, volume 0.15251027456194388
  dito.ts  2.7537999991327524 ms, volume 0.0858536575912676
For 4800 points at 2-1-3
  CesiumJS 0.6586999986320734 ms, volume 0.12324223448049249
  dito.ts  3.595499999821186 ms, volume 0.12704844988994513
For 6000 points at 2-1-4
  CesiumJS 0.7775999996811152 ms, volume 0.15742640747699937
  dito.ts  4.7019999995827675 ms, volume 0.16515438144334035
For 1800 points at 2-2-0
  CesiumJS 0.3096000012010336 ms, volume 0.02052208146220721
  dito.ts  1.4318000003695488 ms, volume 0.017797694204635513
For 3600 points at 2-2-1
  CesiumJS 0.5011999998241663 ms, volume 0.12926543281276145
  dito.ts  2.7213000003248453 ms, volume 0.09664152807378432
For 5400 points at 2-2-2
  CesiumJS 0.6894000004976988 ms, volume 0.39836824883197464
  dito.ts  3.9451999999582767 ms, volume 0.15230158015194292
For 7200 points at 2-2-3
  CesiumJS 1.0109999999403954 ms, volume 0.4060369232428215
  dito.ts  5.363900000229478 ms, volume 0.22059794132505922
For 9000 points at 2-2-4
  CesiumJS 1.1238000001758337 ms, volume 0.5083824258185183
  dito.ts  6.545200001448393 ms, volume 0.3034116296818223
For 2400 points at 2-3-0
  CesiumJS 0.35050000064074993 ms, volume 0.020714331116468764
  dito.ts  1.8231000006198883 ms, volume 0.026139849030067223
For 4800 points at 2-3-1
  CesiumJS 0.6915999986231327 ms, volume 0.1221598963577728
  dito.ts  4.296300001442432 ms, volume 0.12706745452891416
For 7200 points at 2-3-2
  CesiumJS 0.9396999999880791 ms, volume 0.40788326652403584
  dito.ts  5.162599999457598 ms, volume 0.23353098381405335
For 9600 points at 2-3-3
  CesiumJS 1.233899999409914 ms, volume 0.6175885541831254
  dito.ts  6.821699999272823 ms, volume 0.3245694339203368
For 12000 points at 2-3-4
  CesiumJS 1.536199999973178 ms, volume 0.4088271587369035
  dito.ts  9.149899998679757 ms, volume 0.42368929789941945
For 3000 points at 2-4-0
  CesiumJS 0.4221000000834465 ms, volume 0.02738746294827882
  dito.ts  2.192900000140071 ms, volume 0.03384291731706872
For 6000 points at 2-4-1
  CesiumJS 0.9415999986231327 ms, volume 0.1583772850550177
  dito.ts  4.413100000470877 ms, volume 0.15524333335386575
For 9000 points at 2-4-2
  CesiumJS 1.16300000064075 ms, volume 0.53221840469877
  dito.ts  6.496600000187755 ms, volume 0.42115612164306326
For 12000 points at 2-4-3
  CesiumJS 1.526799999177456 ms, volume 0.41072853674120713
  dito.ts  8.879100000485778 ms, volume 0.4085643299999463
For 15000 points at 2-4-4
  CesiumJS 1.8915999997407198 ms, volume 1.0442540923977681
  dito.ts  10.964600000530481 ms, volume 0.5699519685751422
For 800 points at 3-0-0
  CesiumJS 0.15270000137388706 ms, volume 0.003358729073599227
  dito.ts  0.6186999995261431 ms, volume 0.0026743799778534837
For 1600 points at 3-0-1
  CesiumJS 0.2665999997407198 ms, volume 0.011362418614167534
  dito.ts  1.2410000003874302 ms, volume 0.01988193548911047
For 2400 points at 3-0-2
  CesiumJS 0.3389999996870756 ms, volume 0.021893584163853848
  dito.ts  1.858500000089407 ms, volume 0.03076745472983025
For 3200 points at 3-0-3
  CesiumJS 0.46419999934732914 ms, volume 0.05576466898835625
  dito.ts  3.2828999999910593 ms, volume 0.03089538639838626
For 4000 points at 3-0-4
  CesiumJS 0.5681999996304512 ms, volume 0.042029644660333355
  dito.ts  3.0314000006765127 ms, volume 0.05476247227230636
For 1600 points at 3-1-0
  CesiumJS 0.2796000000089407 ms, volume 0.011344643571861388
  dito.ts  1.2690999992191792 ms, volume 0.016252957158570516
For 3200 points at 3-1-1
  CesiumJS 0.4668000005185604 ms, volume 0.12176437759713854
  dito.ts  2.361600000411272 ms, volume 0.06633698168427066
For 4800 points at 3-1-2
  CesiumJS 0.6351000014692545 ms, volume 0.12436318632977592
  dito.ts  3.605500001460314 ms, volume 0.12253994749283635
For 6400 points at 3-1-3
  CesiumJS 0.8248999994248152 ms, volume 0.3251251255374873
  dito.ts  4.872399998828769 ms, volume 0.18662761301067782
For 8000 points at 3-1-4
  CesiumJS 1.0734000001102686 ms, volume 0.23134387947993384
  dito.ts  6.216300001367927 ms, volume 0.2574969558981358
For 2400 points at 3-2-0
  CesiumJS 0.4174000006169081 ms, volume 0.020728243131939703
  dito.ts  1.8671000003814697 ms, volume 0.02613530646871273
For 4800 points at 3-2-1
  CesiumJS 0.6642000004649162 ms, volume 0.1203931104239752
  dito.ts  3.9814999997615814 ms, volume 0.11811717039420738
For 7200 points at 3-2-2
  CesiumJS 0.9800000004470348 ms, volume 0.2226988645041378
  dito.ts  5.217299999669194 ms, volume 0.23044476216721113
For 9600 points at 3-2-3
  CesiumJS 1.2971999999135733 ms, volume 0.5982694947991226
  dito.ts  7.269600000232458 ms, volume 0.33081984034107015
For 12000 points at 3-2-4
  CesiumJS 1.6554000005126 ms, volume 0.416880359814506
  dito.ts  9.041999999433756 ms, volume 0.4243957714551935
For 3200 points at 3-3-0
  CesiumJS 0.44669999927282333 ms, volume 0.04571361834016176
  dito.ts  2.39919999986887 ms, volume 0.047541721056089954
For 6400 points at 3-3-1
  CesiumJS 0.8193000014871359 ms, volume 0.3221168285641916
  dito.ts  4.683800000697374 ms, volume 0.1732067965182585
For 9600 points at 3-3-2
  CesiumJS 1.2495000008493662 ms, volume 0.5971351582436517
  dito.ts  7.428000001236796 ms, volume 0.345344558631812
For 12800 points at 3-3-3
  CesiumJS 1.7176000010222197 ms, volume 1.1144775489752166
  dito.ts  11.877199999988079 ms, volume 0.49712314164904103
For 16000 points at 3-3-4
  CesiumJS 2.073300000280142 ms, volume 1.1534817746853145
  dito.ts  11.836600000038743 ms, volume 0.6252112955138042
For 4000 points at 3-4-0
  CesiumJS 0.5846999995410442 ms, volume 0.03981253028881709
  dito.ts  3.0698000006377697 ms, volume 0.048583327380191735
For 8000 points at 3-4-1
  CesiumJS 1.0249000005424023 ms, volume 0.2278835183556407
  dito.ts  5.901900000870228 ms, volume 0.22668384384511417
For 12000 points at 3-4-2
  CesiumJS 2.9773999992758036 ms, volume 0.41554641174898305
  dito.ts  8.804400000721216 ms, volume 0.444934241744519
For 16000 points at 3-4-3
  CesiumJS 2.02419999986887 ms, volume 1.1212970319678606
  dito.ts  11.884099999442697 ms, volume 0.6559435898676844
For 20000 points at 3-4-4
  CesiumJS 2.5625 ms, volume 1.4975200387884717
  dito.ts  15.737999999895692 ms, volume 0.8311300389997341
For 1000 points at 4-0-0
  CesiumJS 0.1619000006467104 ms, volume 0.004498556416395619
  dito.ts  0.8904000017791986 ms, volume 0.002490043394468262
For 2000 points at 4-0-1
  CesiumJS 0.31479999981820583 ms, volume 0.014944190432309436
  dito.ts  1.5623000003397465 ms, volume 0.02300209570961475
For 3000 points at 4-0-2
  CesiumJS 0.41530000045895576 ms, volume 0.027972833758624773
  dito.ts  2.2565000001341105 ms, volume 0.03586056551906563
For 4000 points at 4-0-3
  CesiumJS 0.5272000003606081 ms, volume 0.04238265230232987
  dito.ts  2.9631999991834164 ms, volume 0.04074588818654479
For 5000 points at 4-0-4
  CesiumJS 0.6590999998152256 ms, volume 0.09590080748411617
  dito.ts  3.610700000077486 ms, volume 0.053585206523876834
For 2000 points at 4-1-0
  CesiumJS 0.29379999823868275 ms, volume 0.01491404776759059
  dito.ts  1.5219999998807907 ms, volume 0.021079817322065028
For 4000 points at 4-1-1
  CesiumJS 0.5391000006347895 ms, volume 0.15156387397587362
  dito.ts  3.9435999989509583 ms, volume 0.08865151605438021
For 6000 points at 4-1-2
  CesiumJS 0.7986000012606382 ms, volume 0.1584744345380946
  dito.ts  4.520399998873472 ms, volume 0.17872771490479114
For 8000 points at 4-1-3
  CesiumJS 1.057599999010563 ms, volume 0.23214108811370365
  dito.ts  6.080900000408292 ms, volume 0.23830538096893053
For 10000 points at 4-1-4
  CesiumJS 1.2406000010669231 ms, volume 0.5595914484315286
  dito.ts  7.731100000441074 ms, volume 0.31923709355538804
For 3000 points at 4-2-0
  CesiumJS 0.41290000081062317 ms, volume 0.027328267949454473
  dito.ts  2.1400000005960464 ms, volume 0.04265028496188539
For 6000 points at 4-2-1
  CesiumJS 0.77280000038445 ms, volume 0.15704153603294327
  dito.ts  4.461499998345971 ms, volume 0.21956634964491153
For 9000 points at 4-2-2
  CesiumJS 1.1549999993294477 ms, volume 0.4841921564044637
  dito.ts  6.8601000010967255 ms, volume 0.2998033823472016
For 12000 points at 4-2-3
  CesiumJS 1.5761999990791082 ms, volume 0.41639178123805837
  dito.ts  8.5168999992311 ms, volume 0.43072586155742754
For 15000 points at 4-2-4
  CesiumJS 2.098999999463558 ms, volume 1.0101538040290534
  dito.ts  11.29619999974966 ms, volume 0.5868637272751012
For 4000 points at 4-3-0
  CesiumJS 0.5339999999850988 ms, volume 0.03962726020221057
  dito.ts  2.961199998855591 ms, volume 0.050339508407475274
For 8000 points at 4-3-1
  CesiumJS 1.0254000015556812 ms, volume 0.2274469239046654
  dito.ts  5.66499999910593 ms, volume 0.31910028210321634
For 12000 points at 4-3-2
  CesiumJS 1.497800000011921 ms, volume 0.4124093565975989
  dito.ts  8.601700000464916 ms, volume 0.4198289623369002
For 16000 points at 4-3-3
  CesiumJS 2.061700001358986 ms, volume 1.0676605066790688
  dito.ts  11.913700001314282 ms, volume 0.6454510065467387
For 20000 points at 4-3-4
  CesiumJS 2.507099999114871 ms, volume 1.5090845764627998
  dito.ts  15.747999999672174 ms, volume 0.8173437554177725
For 5000 points at 4-4-0
  CesiumJS 0.6489000003784895 ms, volume 0.09001510156491994
  dito.ts  3.552699999883771 ms, volume 0.058412210374048756
For 10000 points at 4-4-1
  CesiumJS 1.2977000009268522 ms, volume 0.5590811116574148
  dito.ts  7.748800000175834 ms, volume 0.3356734229218173
For 15000 points at 4-4-2
  CesiumJS 2.015699999406934 ms, volume 0.7847651318642277
  dito.ts  11.251499999314547 ms, volume 0.5652999098177591
For 20000 points at 4-4-3
  CesiumJS 2.9890000000596046 ms, volume 1.5298360341995798
  dito.ts  14.39860000088811 ms, volume 0.9106278965506073
For 25000 points at 4-4-4
  CesiumJS 3.539799999445677 ms, volume 2.882371452162647
  dito.ts  18.610100001096725 ms, volume 0.9997542689044362

@javagl
Copy link
Contributor Author

javagl commented Nov 7, 2023

As another example, the new output for the data that was shown in the first screenshot of the first post here:

Cesium OBB tileset JSON

The bounding boxes originally had been rotated a bit, but now are basically as small as they can be.

@javagl javagl marked this pull request as ready for review November 7, 2023 18:44
@lilleyse lilleyse merged commit 453f6f9 into main Nov 9, 2023
2 checks passed
@lilleyse lilleyse deleted the bounding-volume-computation branch November 9, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants