Skip to content

Commit 5718fab

Browse files
committed
fix(modeling): added path3.clone()
1 parent fbeb95b commit 5718fab

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import type { Path3 } from './type.d.ts'
2+
3+
export function clone(geometry: Path3): Path3
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Performs a shallow clone of the give geometry.
3+
*
4+
* @param {Path3} geometry - the geometry to clone
5+
* @returns {Path3} a new path
6+
* @alias module:modeling/path3.clone
7+
*
8+
* @example
9+
* let newPath = path3.clone(oldPath)
10+
*/
11+
export const clone = (geometry) => Object.assign({}, geometry)

packages/modeling/src/geometries/path3/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export { clone } from './clone.js'
12
export { close } from './close.js'
23
export { concat } from './concat.js'
34
export { create } from './create.js'

packages/modeling/src/geometries/path3/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* }
2525
*/
2626

27+
export { clone } from './clone.js'
2728
export { close } from './close.js'
2829
export { concat } from './concat.js'
2930
export { create } from './create.js'

0 commit comments

Comments
 (0)