add grid lines toggling

This commit is contained in:
Stewart Allen 2022-01-07 21:32:53 -05:00
commit 798bf1750d
4 changed files with 18 additions and 3 deletions

View file

@ -267,6 +267,14 @@ let api = mesh.api = {
));
},
grid(state = {toggle:true}) {
if (state.toggle) {
space.platform.showGrid(!space.platform.isGridVisible());
} else {
space.platform.showGrid(state);
}
},
wireframe(state = {toggle:true}, opt = {opacity:0.15}) {
for (let m of api.model.list()) {
m.wireframe(state, opt);

View file

@ -179,6 +179,7 @@ function ui_build() {
h.button({ _: 'analyze', disabled: true }),
h.button({ _: 'repair', onclick: api.tool.repair }),
h.div({ class: "vsep" }),
h.button({ _: 'gridlines', onclick() { api.grid() } }),
h.button({ _: 'wireframe', onclick() { api.wireframe() } }),
]),
]);