import React from 'react'; export default class SlicerViewer extends React.Component { state = { slice: 0 }; changeSlider = (event) => { this.setState({ ...this.state, slice: parseInt(event.target.value) }); }; render() { const { slice } = this.state; const { layerIntersectionPoints, settings, layerShapes } = this.props; const numLayers = settings.dimensionsZ / settings.layerHeight; const intersectionPoints = layerIntersectionPoints[slice + 1]; const shape = layerShapes[slice]; return (
{intersectionPoints.map(({ x, y }, i) => )} {shape && shape.closedShapes.map((closedShape, i) => ( `${x} ${y}`).join(' ')} fill="rgba(255, 0, 0, 0.5)" /> ))}
); } }