You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: open_vector_format.proto
+31-13Lines changed: 31 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -488,49 +488,67 @@ message VectorBlock {
488
488
WIRESTRUCTURE=2;
489
489
POINTS=3;
490
490
}
491
+
492
+
//--- Vetor Block Type Definitions ---
493
+
//--- OVF performance: why use unstructured repeated float in vector block type definitions? ---
494
+
495
+
//The choice of using unstructured repeated float in OVF is very deliberate and the reasoning is performance.
496
+
//Approx. 99% of the data volume in OVF is the coordinate data.
497
+
//Using repeated float enables reinterpreting the float data as an array of structs using equivalents of "memcast" in the target programming languages.
498
+
//This enables using different definitions of point structs without allocating again or copying the data.
499
+
500
+
//Example use cases are struct definitions for different domain models or libraries,
501
+
//or Single Input Multipe Data (SIMD) vector types.
502
+
//Zero copy in place is the minimal overhead possible of any solution.
503
+
//This works in all cases where libraries use single precision floats.
504
+
505
+
//Using repeated float also minimizes overhead in the wire format.
506
+
//The resulting packed proto encoding only needs a single TAG byte and a varint for the length,
507
+
//resulting in only 2-5 bytes of encoding overhead per vector block.
508
+
//"Parsing" repeated float is a minimal overhead memcopy of the floating point data, e.g. from the file/network stream buffer.
491
509
492
510
//LineSequence:
493
511
//A lineSequence is defined by a set of vertex points (x,y),
494
512
//connected contiguously in the listed order by straight line segments.
495
513
//A closed lineSequence can also be called a polygon.
496
514
messageLineSequence {
497
-
repeatedfloatpoints=1;
515
+
repeatedfloatpoints=1;// len % 2 == 0, len >= 4
498
516
}
499
517
500
518
//LineSequence3D:
501
519
//A lineSequence3D is defined by a set of vertex points (x,y,z) in 3D space,
502
520
//connected contiguously in the listed order by straight line segments.
503
521
//A closed lineSequence can also be called a polygon.
504
522
messageLineSequence3D {
505
-
repeatedfloatpoints=1;
523
+
repeatedfloatpoints=1;// len % 3 == 0, len >= 6
506
524
}
507
525
508
526
//Hatches:
509
527
//A hatch is a set of independent straight lines,
510
528
//each defined by one start and one end point (x,y) for 2D.
511
529
messageHatches {
512
-
repeatedfloatpoints=1;
530
+
repeatedfloatpoints=1;// len % 4 == 0, len >= 4
513
531
}
514
532
515
533
//Hatches3D:
516
534
//A hatch is a set of independent straight lines,
517
535
//each defined by one start and one end point (x,y,z) for 3D.
518
536
messageHatches3D {
519
-
repeatedfloatpoints=1;
537
+
repeatedfloatpoints=1;// len % 6 == 0, len >= 6
520
538
}
521
539
522
540
//PointSequence:
523
541
//A point sequence is a set of points, each marked
524
542
//for a fixed period of time. Each point consists of (x,y) for 2D.
525
543
messagePointSequence {
526
-
repeatedfloatpoints=1;
544
+
repeatedfloatpoints=1;// len % 2 == 0, len >= 2
527
545
}
528
546
529
547
//PointSequence3D:
530
548
//A point sequence is a set of points, each marked
531
549
//for a fixed period of time. Each point consists of (x,y,z) for 3D.
532
550
messagePointSequence3D {
533
-
repeatedfloatpoints=1;
551
+
repeatedfloatpoints=1;// len % 3 == 0, len >= 3
534
552
}
535
553
536
554
//An arc is defined by a start point on the circle,
@@ -542,7 +560,7 @@ message VectorBlock {
542
560
doubleangle=1;
543
561
floatstart_dx=2;
544
562
floatstart_dy=3;
545
-
repeatedfloatcenters=4;
563
+
repeatedfloatcenters=4;// len % 2 == 0, len >= 2
546
564
}
547
565
548
566
//An arc3D (edge of a plate) is defined by a start point on the circle,
@@ -555,7 +573,7 @@ message VectorBlock {
555
573
floatstart_dx=2;
556
574
floatstart_dy=3;
557
575
floatstart_dz=4;
558
-
repeatedfloatcenters=5;
576
+
repeatedfloatcenters=5;// len % 3 == 0, len >= 3
559
577
}
560
578
561
579
//An ellipse is defined like an arc, with additional parameters
@@ -580,7 +598,7 @@ message VectorBlock {
580
598
//scaling linear along the vector. The goal gets priority and overwrites settings of the
581
599
//parameter set.
582
600
messageLineSequenceParaAdapt {
583
-
repeatedfloatpoints_with_paras=1;
601
+
repeatedfloatpoints_with_paras=1;// len % 3 == 0, len >= 3
0 commit comments