API 參考

@univerjs-pro/engine-shape

此 API 頁面目前提供英文內容。程式碼簽名與識別符不隨介面語言變更。

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.

你覺得這篇文檔如何?

© 2026 DreamNum Co., Ltd.