mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-15 21:05:22 +01:00
29 lines
873 B
JavaScript
29 lines
873 B
JavaScript
import {box} from '../../../brep/brep-primitives'
|
|
import {BREPSceneSolid} from '../../scene/wrappers/brepSceneObject';
|
|
import {createPreviewer} from "../../preview/scenePreviewer";
|
|
import {createBoxGeometry} from "../../../../../modules/scene/geoms";
|
|
|
|
const METADATA = [
|
|
['width' , 'number', 500, {min: 0}],
|
|
['height' , 'number', 500, {min: 0}],
|
|
['depth' , 'number', 500, {min: 0}]
|
|
];
|
|
|
|
function createBox(cadRegistry, {width, height, depth}) {
|
|
return {
|
|
outdated: [],
|
|
created: [new BREPSceneSolid(box(width, height, depth))]
|
|
}
|
|
}
|
|
|
|
export default {
|
|
id: 'BOX',
|
|
metadata: METADATA,
|
|
label: 'Box',
|
|
icon: 'img/cad/box',
|
|
info: 'creates new object box',
|
|
paramsInfo: ({width, height, depth}) => `(${width}, ${height}, ${depth})`,
|
|
previewGeomProvider: ({width, height, depth}) => createBoxGeometry(width, height, depth),
|
|
run: createBox
|
|
};
|
|
|