import React from 'react'; import { PRECISION } from '../src/constants.js'; export default class SlicerViewer extends React.Component { state = { layer: 0, render: { renderIntersectionPoints: false, renderShape1: false, renderShape2: true, renderOuterLine: true, renderInnerLine: true, renderFill: true } }; changeSlider = (event) => { this.setState({ layer: parseInt(event.target.value) }); }; onControl = (event) => { const section = event.target.value; this.setState({ render: { ...this.state.render, [section]: !this.state.render[section] } }); }; render() { const { layer, render } = this.state; const { layerIntersectionPoints, settings, layerShapes, slices } = this.props; const numLayers = settings.dimensionsZ / settings.layerHeight; const intersectionPoints = layerIntersectionPoints[layer + 1]; const shape = layerShapes[layer]; const slice = slices[layer]; return (
Layer: {layer}