You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
1.1 KiB

import { UIDiv, UIButton, UIRow } from './libs/ui.js';
function SidebarGeometryModifiers( editor, object ) {
const strings = editor.strings;
const signals = editor.signals;
const container = new UIDiv().setPaddingLeft( '90px' );
const geometry = object.geometry;
// Compute Vertex Normals
const computeVertexNormalsButton = new UIButton( strings.getKey( 'sidebar/geometry/compute_vertex_normals' ) );
computeVertexNormalsButton.onClick( function () {
geometry.computeVertexNormals();
signals.geometryChanged.dispatch( object );
} );
const computeVertexNormalsRow = new UIRow();
computeVertexNormalsRow.add( computeVertexNormalsButton );
container.add( computeVertexNormalsRow );
// Center Geometry
const centerButton = new UIButton( strings.getKey( 'sidebar/geometry/center' ) );
centerButton.onClick( function () {
geometry.center();
signals.geometryChanged.dispatch( object );
} );
const centerRow = new UIRow();
centerRow.add( centerButton );
container.add( centerRow );
//
return container;
}
export { SidebarGeometryModifiers };