Partager via


Extrusion Class

3D Extrusion.When the object is serialized out as xml, its qualified name is o:extrusion.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Vml.Office.Extrusion

Namespace:  DocumentFormat.OpenXml.Vml.Office
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Class Extrusion _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As Extrusion
public class Extrusion : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 1st Edition]

14.2.2.11 extrusion (3D Extrusion)

This element specifies a parallel or perspective extrusion of a 2-D shape, creating the appearance of a 3-D shape. Lighting is controlled via two independent point light sources. Extrusions are defined as either perspective or parallel.

[Example:

<v:polyline points="0pt,75pt 20pt,45pt 10pt,50pt 30pt,10pt 
  50pt,50pt 40pt,45pt 60pt,75pt 0pt,75pt" fillcolor="#00a000">
  <o:extrusion on="t" backdepth="20pt"
    lightposition="30000,10000,10000"/>
</v:polyline>

DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

Parent Elements

arc (§14.1.2.1); background (Part 1, §17.2.1); curve (§14.1.2.3); group (§14.1.2.7); hdrShapeDefaults (§9.7.2.1); image (§14.1.2.10); line (§14.1.2.12); object (Part 1, §17.3.3.19); oval (§14.1.2.13); pict (§9.2.2.2); pict (§9.5.1); polyline (§14.1.2.15); rect (§14.1.2.16); roundrect (§14.1.2.17); shape (§14.1.2.19); shapeDefaults (§9.7.2.2); shapedefaults (§14.2.2.28); shapetype (§14.1.2.20)

Attributes

Description

autorotationcenter (Center of Rotation Toggle)

Specifies whether the center of rotation is the geometric center of the extrusion. Default is false. If true, the geometric center of an extruded shape is (0,0,0). If false, the center of rotation is determined by the rotationcenter attribute.

The possible values for this attribute are defined by the ST_TrueFalse simple type (§15.1.2.5).

backdepth (Backward Extrusion Depth)

Specifies the amount of backward extrusion. Default is 36 pt, default units are points.

[Example:

<o:extrusion on="true" backdepth="15pt">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

brightness (Brightness)

Specifies the overall brightness of a scene. Default is 0.3. This numeric value can also be specified in 1/65536-ths if a trailing "f" is supplied (as "f" indicates the value is a fraction). For example, a value of "52429f" represents 52429/65536 or 0.8.

This quantity is not specified using units. The numeric values range from 0 to 1 (0f to 65536f), where 0 implies darkness and 1 implies light saturation.

[Example:

<o:extrusion on="true" brightness="0.4">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

color (Extrusion Color)

Specifies the color of the extrusion faces. This attribute is only used when colormode is custom. Colors are typically specified as either a named color, such as red, or six hexadecimal digits representing the red, green and blue values of the color, such as #00FF30. Full details are specified in the simple type description.

[Example:

<o:extrusion on="true" color="lime" 
  colormode="custom">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_ColorType simple type (§15.1.2.3).

colormode (Extrusion Color Mode)

Specifies whether the extrusion color is defined by the color attribute or is the same as the shape's fill color. Default is auto.

[Example:

<o:extrusion on="true" color="lime" 
  colormode="auto">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_ColorMode simple type (§14.2.3.6).

diffusity (Diffuse Reflection)

Specifies the amount of diffusion of reflected light from an extruded shape, defined as the ratio of incident light to diffused reflected light. Default is 1. Normal values range from 0 to 1. This numeric value can also be specified in 1/65536-ths if a trailing "f" is supplied (as "f" indicates the value is a fraction). [Example: A value of "52429f" represents 52429/65536 or 0.8. end example]

This quantity is not specified using units. The numeric values range from 0 to 1 (0f to 65536f), where 0 implies all reflected light is diffuse and 1 implies no reflected light is diffuse.

Specularity and diffusity should be considered together as it is possible, though physically incorrect, to define more reflected light than incident light. This is the case if the amount of specularly reflected light and diffusely reflected light add up to more than the amount of incident light.

[Example:

<o:extrusion on="true" diffusity=".75">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

edge (Simulated Bevel)

Specifies the apparent bevel of the extrusion edges. Default is 1 point.

[Example:

<o:extrusion on="true" edge="2pt">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

ext (VML Extension Handling Behavior)

Namespace: urn:schemas-microsoft-com:vml

Specifies an optional value that indicates how applications that implement VML should interpret extensions not defined as part of the original specification of core VML.

[Rationale: This part of the original VML specification is included to assist applications that leverage existing VML support in implementing the Office Open XML Format. end rationale]

The possible values for this attribute are defined by the ST_Ext simple type (§14.1.3.2).

facet (Faceting Quality)

Specifies the quality with which the application approximates curved surfaces of an extrusion. A higher facet value produces shapes with smoother curves. A lower value reduces smoothing, resulting in curves with sharper, jagged edges. Default is 30000.

Allowed values range from 1 to 65536, where 1 implies extremely low quality curve approximation and 65536 implies extremely high quality.

[Example:

<o:extrusion on="true" facet="65536">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

foredepth (Forward Extrusion)

Specifies the amount of forward extrusion. Default is 0 pt, default units are points.

[Example:

<o:extrusion on="true" foredepth="25pt">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

lightface (Shape Face Lighting Toggle)

Specifies whether the front face of the extrusion responds to changes in the lighting. If false, the front face does not respond when a lighting value changes. Default is true.

[Example: The front face is colored as if the shape were not extruded and lit by a 3-D light source:

<o:extrusion on="true" lightface="false">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_TrueFalse simple type (§15.1.2.5).

lightharsh (Primary Light Harshness Toggle)

Specifies whether the primary light source is harsh. If false, shadow boundaries are diffused. Default is true.

[Example: The secondary light source is turned off so only the primary has an effect:

<o:extrusion on="true" lightharsh="false" 
  lightlevel2="0">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_TrueFalse simple type (§15.1.2.5).

lightharsh2 (Secondary Light Harshness Toggle)

Specifies whether the secondary light source is harsh. If false, shadow boundaries defined by the secondary light source are diffused. Default is false.

The possible values for this attribute are defined by the ST_TrueFalse simple type (§15.1.2.5).

lightlevel (Primary Light Intensity)

Specifies the intensity of the primary light source for the scene. Default is 0.6. This numeric value can also be specified in 1/65536-ths if a trailing "f" is supplied (as "f" indicates the value is a fraction). [Example: A value of "52429f" represents 52429/65536 or 0.8. end example]

This quantity is not specified using units. The numeric values range from 0 to 1 (0f to 65536f), where 0 implies no direct light and 1 implies saturated direct light.

[Example: The secondary light source is turned off so only the primary has an effect:

<o:extrusion on="true" lightlevel=".5"
  lightlevel2="0">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

lightlevel2 (Secondary Light Intensity)

Specifies the intensity of the secondary light source for the scene. Default is 0.6. This numeric value can also be specified in 1/65536-ths if a trailing "f" is supplied (as "f" indicates the value is a fraction). [Example: A value of "52429f" represents 52429/65536 or 0.8. end example]

This quantity is not specified using units. The numeric values range from 0 to 1 (0f to 65536f), where 0 implies no direct light and 1 implies saturated direct light.

The possible values for this attribute are defined by the W3C XML Schema string datatype.

lightposition (Primary Light Position)

Specifies the normalized X,Y,Z position of the primary light in a scene in 1/65536-ths. Default is "50000,0,10000". The use of a normalized vector from the shape origin effectively establishes the direction of the light relative to the shape. The distance of the light from the shape is irrelevant as the light source is treated as a directional light.

The position "0,0,0" is at the center of the shape. Positive numbers move the light to the right, down and toward the viewer, respectively.

[Example: The secondary light source is turned off so only the primary has an effect:

<o:extrusion on="true" lightlevel2="0"
  lightposition="7000,-13000,20000">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

lightposition2 (Secondary Light Position)

Specifies the X,Y,Z position of the secondary light in a scene in 1/65536-ths. Default is "-50000,0,10000". The use of a normalized vector from the shape origin effectively establishes the direction of the light relative to the shape. The distance of the light from the shape is irrelevant as the light source is treated as a directional light.

The position "0,0,0" is at the center of the shape. Positive numbers move the light to the right, down and toward the viewer, respectively.

The possible values for this attribute are defined by the W3C XML Schema string datatype.

lockrotationcenter (Rotation Toggle)

Specifies whether the rotation of the extruded object is specified by the rotationangle attribute. If false, the rotation is specified by the orientation attribute. Default is true.

[Example: The following snippets are equivalent:

<o:extrusion lockrotationcenter="false" 
  orientationangle="45" orientation="0,1,0">
</o:extrusion>
<o:extrusion lockrotationcenter=true 
  rotationangle="45"/>
</o:extrusion>

end example]

The possible values for this attribute are defined by the ST_TrueFalse simple type (§15.1.2.5).

metal (Metallic Surface Toggle)

Specifies whether the surface of the extruded shape resembles metal. Default is false.

If true, this attribute causes the specularly reflected light to be the material color instead of the light source color, making the object seem more metallic. To further approximate a metallic material requires that specularity be relatively high (about 1.2) and diffusity be relatively low (about 0.6).

[Example:

<o:extrusion on="true" metal="true" 
  lightposition="10000,-10000,10000" 
  lightlevel2="0" specularity="1.2" 
  diffusity="0.6">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_TrueFalse simple type (§15.1.2.5).

on (Extrusion Toggle)

Specifies whether an extrusion is displayed. Default is false.

[Example:

<v:rect style="width=50;height=50">
  <o:extrusion />
</v:rect>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_TrueFalse simple type (§15.1.2.5).

orientation (Rotation Axis)

Specifies a vector in 3D space around which the shape is rotated, as given by the orientationangle attribute. Default is "100,0,0".

The position "0,0,0" is at the center of the shape. Positive numbers are to the right, down and toward the viewer, respectively.

[Example:

<o:extrusion … orientation="200,0,0">
</o:extrusion>

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

orientationangle (Rotation Around Axis)

Specifies the angle, in degrees, that an extrusion rotates around the orientation. Default is 0.

[Example:

<o:extrusion … orientationangle="30">
</o:extrusion>

end example]

The possible values for this attribute are defined by the W3C XML Schema float datatype.

plane (Extrusion Direction)

Specifies the plane that is at right angles to the extrusion. Default is xy. Allowed values are:

  • xy

  • zx

  • yz

[Example:

<o:extrusion on="true" plane="yz"
  backdepth="100pt">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_ExtrusionPlane simple type (§14.2.3.11).

render (Extrusion Render Mode)

Specifies the rendering mode of the extrusion. Default is solid. Allowed values are:

Value

Description

solid

Rendering displays a solid shape.

wireframe

Rendering displays a wireframe shape.

boundingcube

Rendering displays the bounding cube that contains the shape.

[Example:

<o:extrusion on="true" render="wireframe">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_ExtrusionRender simple type (§14.2.3.12).

rotationangle (X-Y Rotation Angle)

Specifies the rotation of the object about the x- and y-axes, in degrees. Default is "0,0". Positive angles are measured clockwise around the axis (as if viewing from the positive axis).

The rotation of the object is defined by a rotation angle about the y-axis followed by the rotation angle about the x-axis. The z-axis angle is controlled by the value of the CSS style attribute's rotation property.

[Example:

<o:extrusion on="t" lockrotationcenter="true" 
  rotationangle="10,20">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

rotationcenter (Rotation Center)

Specifies the center of rotation for a shape if autorotationcenter is false. The offset of the rotation is specified in terms of fractions of the shape's size. Default is "0,0,0".

The position "0,0,0" is at the center of the shape. Positive numbers are to the right, down and toward the viewer, respectively.

The possible values for this attribute are defined by the W3C XML Schema string datatype.

shininess (Shininess)

Specifies the concentration of the reflected light on an extrusion surface. Default is 5. The range of values should be constrained to 0-10. Reflection intensity typically grows exponentially with the shininess value.

High values (8-10) approximate the shininess of a mirror and low values (2-3) approximate a speckled effect. Reflections do not mirror other objects; only pinpoint light sources are reflected.

The possible values for this attribute are defined by the W3C XML Schema float datatype.

skewamt (Extrusion Skew)

Specifies the amount of skew, or length, of a parallel extrusion. Default is 50%. Applies only if the extrusion type is parallel. This attribute and backdepth interact to create the actual extrusion length. Allowed values range from 0 (0%) to 1 (100%).

[Example:

<o:extrusion on="true" skewamt="100%">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

skewangle (Extrusion Skew Angle)

Specifies the angle of the skew of a parallel extrusion. Default is 225 degrees. Angles are measured in degrees, counterclockwise from the negative x-axis. Applies only if the extrusion type is parallel.

[Example:

<o:extrusion on="true" skewangle="25">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema float datatype.

specularity (Specularity)

Specifies the specularity of an extruded shape, defined as the ratio of incident light to specularly reflected light. Default is 0. Normal values range from 0 to 1. This numeric value can also be specified in 1/65536-ths if a trailing "f" is supplied (as "f" indicates the value is a fraction). [Example: A value of "52429f" represents 52429/65536 or 0.8. end example]

Specularity and diffusity should be considered together as it is possible, though physically incorrect, to define more reflected light than incident light. This is the case if the amount of specularly reflected light and diffusely reflected light add up to more than the amount of incident light.

[Example: The secondary light source is turned off so only the primary has an effect. Although the effect is subtle, the first cylinder has a sharper specular reflection on its edge:

<o:extrusion on="true" specularity="1" 
  lightposition="10000,-10000,10000" 
  lightlevel2="0">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

type (Extrusion Type)

Specifies the way that the shape is extruded. Default is parallel. Allowed values are:

Value

Description

parallel

Extrusion is rendered so that the center of projection is infinitely far away; that is, the extrusion lines do not converge (unlike perspective projections).

perspective

Extrusion is rendered to a center of projection, which is the same as the vanishing point for unrotated objects.

[Example:

<o:extrusion on="true" type="parallel" 
  backdepth="100pt">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the ST_ExtrusionType simple type (§14.2.3.13).

viewpoint (Extrusion Viewpoint)

Specifies the viewpoint of the observer in EMUs. This is effectively the end of a vector extending from the viewpointorigin.

The position "0,0,0" is at the center of the shape. Positive numbers are to the right, down and toward the viewer, respectively.

[Example:

<o:extrusion on="true" type="perspective" 
  viewpoint="500000,-100000,100000">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

viewpointorigin (Extrusion Viewpoint Origin)

Specifies the origin of the viewpoint vector for perspective extrusions. This is the origin of the vector whose opposite end is given by the viewpoint attribute. This origin is always within the bounding box of the shape. Default is "0.5,-0.5".

The viewpoint is specified in terms of the x and y values of the original shape. The x and y values range from 0.5 to -0.5 (50% to -50% of the shape's coordinate origin). Larger numbers move the viewpoint outside the bounding box.

[Example:

<o:extrusion on="true" type="perspective"
  viewpoint="500000,-100000,100000"
  viewpointorigin="0,1">
</o:extrusion>
DocumentFormat.OpenXml.Vml.Office.Extrusion-image0

end example]

The possible values for this attribute are defined by the W3C XML Schema string datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_Extrusion) is located in §A.6.2. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Extrusion Members

DocumentFormat.OpenXml.Vml.Office Namespace