2.1.1316 Part 1 Section 20.1.10.9, ST_BevelPresetType (Bevel Presets)
a. The standard contains a table with examples of the enumeration values, but the examples do not describe how the bevels are defined.
-
Office defines each bevel as 2D curves in a square unit space ({0, 0} to {1, 1}). Unlike a real-world bevel which cuts away from a surface, these conceptually extend a flat face perpendicular to that face.
-
The schema also has bevel width and bevel height attributes. The point (0,0) in this "bevel space" is at the outer edge of the face, the x-coordinate moves away from the face (along the "bevel height"), while the y-coordinate moves inwards towards the interior of the face (along the "bevel width"). The two dimensions in the bevel space are also treated differently in that Office stretches the x-axis to fully fill the bevel height.
-
[Example:
-
Bevel type "cross" ends with x == 0.6, but the geometry created is as tall as with bevel type "angle" which ends at x == 1.0. But for the y-axis Office scales the bevel from {0..1} to {0..bevelWidth}, so that a bevel ending with a point at y < 1 will not move as deeply towards the interior of the shape.
-
end example]
-
Below is pseudocode to assemble geometry for each of the bevel types.
-
angle: BeginFigure( { 0, 0 } ); LineTo( { 1, 1 } ); artDeco: BeginFigure( { 0, 0 } ); BezierTo( { 0.000000, 0.184095 }, { 0.149238, 0.333333 }, { 0.333333, 0.333333 } ); BezierTo( { 0.333333, 0.701523 }, { 0.631810, 1.000000 }, { 1.000000, 1.000000 } ); circle: BeginFigure( { 0, 0 } ); BezierTo( { 0.00000, 0.55627 }, { 0.44373, 1.00000 }, { 1.00000, 1.00000 } ); convex: BeginFigure( { 0, 0 } ); BezierTo( { 0.0000000, 0.070820 }, { 0.0297458, 0.100000 }, { 0.1014160, 0.100000 } ); BezierTo( { 0.5014160, 0.100000 }, { 0.9000000, 0.700000 }, { 0.9014160, 0.899999 } ); BezierTo( { 0.9000000, 0.971670 }, { 0.9334300, 1.000000 }, { 1.0000000, 1.000000 } ); coolSlant: BeginFigure( { 0, 0 } ); BezierTo( { 0.000000, 0.138122 }, { 0.000000, 0.200000 }, { 0.271356, 0.775535 } ); BezierTo( { 0.377654, 1.000000 }, { 0.519455, 1.000000 }, { 0.583589, 1.000000 } ); cross: BeginFigure( { 0, 0 } ); BezierTo( { 0.00000, 0.05563 }, { 0.04437, 0.10000 }, { 0.10000, 0.10000 } ); LineTo( { 0.40000, 0.10000 } ); BezierTo( { 0.45563, 0.10000 }, { 0.50000, 0.14437 }, { 0.50000, 0.20000 } ); LineTo( { 0.50000, 0.90000 } ); BezierTo( { 0.50000, 0.95563 }, { 0.54437, 1.00000 }, { 0.60000, 1.00000 } ); divot: BeginFigure( { 0, 0 } ); BezierTo( { 0.000000, 0.236604 }, { 0.119276, 0.607024 }, { 0.263046, 0.760235 } ); BezierTo( { 0.361098, 0.864726 }, { 0.457934, 0.909567 }, { 0.537806, 0.925082 } ); BezierTo( { 0.559245, 0.929246 }, { 0.567625, 0.897930 }, { 0.542066, 0.845567 } ); BezierTo( { 0.484073, 0.726757 }, { 0.477103, 0.393693 }, { 0.551651, 0.393693 } ); LineTo( { 0.899894, 0.393693 } ); BezierTo( { 0.991480, 0.393693 }, { 0.958466, 0.746659 }, { 0.907348, 0.779629 } ); LineTo( { 0.879394, 0.797658 } ); BezierTo( { 0.845545, 0.819489 }, { 0.848775, 0.954172 }, { 0.874334, 0.971627 } ); QuadraticBezierTo( { 0.915883, 1.000000 }, { 1.000000, 1.000000 } ); hardEdge: BeginFigure( { 0, 0 } ); QuadraticBezierTo( { 0.000000, 0.092437 }, { 0.042353, 0.305322 } ); LineTo( { 0.170124, 0.947558 } ); BezierTo( { 0.177203, 0.983142 }, { 0.200000, 1.000000 }, { 0.268235, 0.998599 } ); LineTo( { 0.614118, 0.998599 } ); BezierTo( { 0.647059, 0.998599 }, { 0.656471, 0.987395 }, { 0.663529, 0.969188 } ); BezierTo( { 0.687006, 0.908633 }, { 0.802353, 0.822129 }, { 1.000000, 0.822129 } ); relaxedInset: BeginFigure( { 0, 0 } ); BezierTo( { 0.000000, 0.367 }, { 0.124605, 0.820 }, { 0.507899, 1.000 } ); BezierTo( { 0.724115, 0.737 }, { 0.790455, 0.640 }, { 1.000000, 0.640 } ); riblet: BeginFigure( { 0, 0 } ); BezierTo( { 0.000000, 0.238519 }, { 0.132047, 0.500741 }, { 0.357567, 0.731852 } ); BezierTo( { 0.513167, 0.891311 }, { 0.563798, 0.912593 }, { 0.735905, 0.912593 } ); LineTo( { 0.873887, 0.912593 } ); BezierTo( { 0.956973, 0.912593 }, { 0.878338, 1.000000 }, { 1.000000, 1.000000 } ); slope: BeginFigure( { 0, 0 } ); QuadraticBezierTo( { 0.00000, 0.12500 }, { 0.02500, 0.25000 } ); LineTo( { 0.12500, 0.75000 } ); BezierTo( { 0.17500, 1.00000 }, { 0.25000, 1.00000 }, { 0.37500, 1.00000 } ); LineTo( { 0.50000, 1.00000 } ); BezierTo( { 0.62500, 1.00000 }, { 0.70000, 1.00000 }, { 0.75000, 0.75000 } ); LineTo( { 0.87500, 0.12500 } ); BezierTo( { 0.90000, 0.01000 }, { 0.98000, 0.01000 }, { 1.00000, 0.01000 } ); softRound: BeginFigure( { 0, 0 } ); BezierTo( { 0.0000000, 0.47750 }, { 0.0968736, 1.00000 }, { 0.1563010, 1.00000 } ); BezierTo( { 0.2641790, 1.00000 }, { 0.3769190, 0.33333 }, { 1.0000000, 0.33333 } );
-