|
@@ -35,7 +35,10 @@ export function computeVolumeSurface(volume: VolumeData, isoValue: VolumeIsoValu
|
|
|
|
|
|
export const DefaultSurfaceProps = {
|
|
|
isoValue: VolumeIsoValue.relative({ min: 0, max: 0, mean: 0, sigma: 0 }, 0),
|
|
|
- alpha: 0.5
|
|
|
+ alpha: 0.5,
|
|
|
+ flatShaded: true,
|
|
|
+ flipSided: true,
|
|
|
+ doubleSided: true
|
|
|
}
|
|
|
export type SurfaceProps = Partial<typeof DefaultSurfaceProps>
|
|
|
|
|
@@ -50,7 +53,7 @@ export default function Surface(): VolumeElementRepresentation<SurfaceProps> {
|
|
|
return Task.create('Point.create', async ctx => {
|
|
|
renderObjects.length = 0 // clear
|
|
|
curProps = { ...DefaultSurfaceProps, ...props }
|
|
|
- const { alpha } = curProps
|
|
|
+ const { alpha, flatShaded, flipSided, doubleSided } = curProps
|
|
|
|
|
|
const mesh = await ctx.runChild(computeVolumeSurface(volume, curProps.isoValue))
|
|
|
|
|
@@ -70,9 +73,9 @@ export default function Surface(): VolumeElementRepresentation<SurfaceProps> {
|
|
|
elementCount: mesh.triangleCount,
|
|
|
positionCount: mesh.vertexCount / 3,
|
|
|
|
|
|
- flatShaded: true,
|
|
|
- doubleSided: true,
|
|
|
- flipSided: true
|
|
|
+ flatShaded,
|
|
|
+ doubleSided,
|
|
|
+ flipSided
|
|
|
})
|
|
|
renderObjects.push(surface)
|
|
|
})
|