Référence de l’API

@univerjs-pro/engine-shape

Cette page API est actuellement disponible en anglais. Les signatures et identifiants restent identiques dans toutes les langues.

Shape rendering models, shape definitions, editable SmartArt data, z-order updates, and conversion utilities for Web SDK.

TypeScript
import { ShapeModel, ShapeTypeEnum } from '@univerjs-pro/engine-shape'

Import @univerjs-pro/engine-shape/facade for live FShape APIs, including SmartArt node and layout editing and setZOrder(index). See the Shape Facade reference for the insertion workflow.

Closed shape geometry

mergeShapeContours(operands, operation, primaryIndex = 0) combines 2–10 IShapeGeometryOperand values. Each contains closed polygon contours and an optional 'nonzero' or 'evenodd' fill rule. ShapeMergeOperation supports 'union', 'combine', 'intersect', 'subtract', and 'fragment'; subtraction removes the other operands from the primary operand. The result is an array of IShapeGeometryResult values containing contours and sourceIndices. Empty intersections can return an empty array. Invalid inputs or excessive geometry complexity throw RangeError.

getShapeGeometryContours(shapeType, shapeData, width, height, tolerance?) extracts supported filled geometry, and createMergedShapeGeometry(contours) produces a custom geometry and its bounds. These helpers do not edit a document or manage text, selection, permissions, or undo. For user-facing Slides editing, use the shape merge command.

Que pensez-vous de ce guide ?

© 2026 DreamNum Co., Ltd.