ThreeDFormat, Camera, LightRig, ShapeBevel — Aspose.Slides FOSS for Python API Reference

ThreeDFormat applies three-dimensional rendering to a shape: bevel edges, extrusion depth, material surface, contour colour, and scene-level camera and lighting. Access it via shape.three_d_format.

Package: aspose.slides_foss


ThreeDFormat

Properties — shape geometry (sp3d)

PropertyTypeAccessDescription
bevel_topShapeBevelReadTop bevel: type and dimensions of the top edge bevel.
bevel_bottomShapeBevelReadBottom bevel: type and dimensions of the bottom edge bevel.
contour_widthfloatRead/WriteWidth of the 3D outline in points.
extrusion_heightfloatRead/WriteExtrusion depth in points (how far the shape extends in Z).
depthfloatRead/WriteZ-offset of the shape from the slide plane, in points.
contour_colorColorFormatReadColour of the 3D outline. Access contour_color.color to set the Color.
extrusion_colorColorFormatReadColour of the extruded face.
materialMaterialPresetTypeRead/WriteSurface material preset: CLEAR, DK_EDGE, FLAT, MATTE, METAL, PLASTIC, POWDER, SOFT_EDGE, SOFTMETAL, TRANSLUCENT_POWDER, WARM_MATTE, LEGACY_MATTE, LEGACY_METAL, LEGACY_PLASTIC, LEGACY_WIREFRAME, NOT_DEFINED.

Properties — scene (scene3d)

PropertyTypeAccessDescription
cameraCameraReadScene camera settings (projection type and rotation).
light_rigLightRigReadScene lighting preset and direction.

ShapeBevel

Represents the bevel applied to one edge of a shape. Access via three_d_format.bevel_top or three_d_format.bevel_bottom.

Properties

PropertyTypeAccessDescription
bevel_typeBevelPresetTypeRead/WriteBevel shape: ANGLE, ART_DECO, CIRCLE, CONVEX, COOL_SLANT, CROSS, DIVOT, HARD_EDGE, RELAXED_INSET, RIBLET, SLOPE, SOFT_ROUND, NOT_DEFINED.
widthfloatRead/WriteBevel width in points.
heightfloatRead/WriteBevel height in points.

Camera

Represents the viewpoint for the 3D scene. Access via three_d_format.camera.

Properties

PropertyTypeAccessDescription
camera_typeCameraPresetTypeRead/WritePreset camera: ISOMETRIC_BOTTOM_DOWN, ISOMETRIC_TOP_UP, OBLIQUE_BOTTOM_LEFT, PERSPECTIVE_FRONT, PERSPECTIVE_LEFT, PERSPECTIVE_RIGHT, PERSPECTIVE_RELAXED, PERSPECTIVE_RELAXED_MODERATELY, and many others.
field_of_view_anglefloatRead/WriteField-of-view angle in degrees (perspective cameras).
zoomfloatRead/WriteCamera zoom factor as a percentage (100 = default).
rotationCameraRotationReadRotation angles (latitude, longitude, revolution) in degrees.

Methods

MethodSignatureDescription
set_rotationset_rotation(latitude, longitude, revolution)Set explicit Euler rotation angles in degrees.

LightRig

Represents the lighting environment for the 3D scene. Access via three_d_format.light_rig.

Properties

PropertyTypeAccessDescription
light_typeLightRigPresetTypeRead/WriteLighting preset: BALANCED, BRIGHT_ROOM, CHILLY, CONTRASTING, FLAT, FLOOD, FREEZING, GLOW, HARSH, LEGEND, MORNING, SOFT, SUNRISE, SUNSET, THREE_PT, TWO_PT.
directionLightingDirectionRead/WriteDirection of the dominant light: TOP, TOP_RIGHT, RIGHT, BOTTOM_RIGHT, BOTTOM, BOTTOM_LEFT, LEFT, TOP_LEFT.
rotationLightRigRotationReadEuler angles of the light rig.

Methods

MethodSignatureDescription
set_rotationset_rotation(latitude, longitude, revolution)Set explicit light-rig rotation angles in degrees.

Usage Example

Raised circle with soft bevel and blue extrusion

import aspose.slides_foss as slides
from aspose.slides_foss import ShapeType, FillType, MaterialPresetType
from aspose.slides_foss.drawing import Color
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    slide = prs.slides[0]
    shape = slide.shapes.add_auto_shape(ShapeType.ELLIPSE, 150, 100, 200, 200)
    shape.fill_format.fill_type = FillType.SOLID
    shape.fill_format.solid_fill_color.color = Color.from_argb(255, 70, 130, 180)

    td = shape.three_d_format

    # Top bevel
    td.bevel_top.width = 8.0
    td.bevel_top.height = 8.0

    # Extrusion
    td.extrusion_height = 20.0
    td.extrusion_color.color = Color.from_argb(255, 30, 80, 130)

    # Material
    td.material = MaterialPresetType.PLASTIC

    prs.save("3d-shape.pptx", SaveFormat.PPTX)

See Also