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.