Skip to content
Snippets Groups Projects
Commit f8ab02fd authored by Alexander Rose's avatar Alexander Rose
Browse files

add doubleSided to quality props

parent b75ba4b4
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ export interface QualityProps { ...@@ -50,6 +50,7 @@ export interface QualityProps {
radialSegments: number radialSegments: number
linearSegments: number linearSegments: number
resolution: number resolution: number
doubleSided: boolean
} }
export function getStructureQuality(structure: Structure): VisualQuality { export function getStructureQuality(structure: Structure): VisualQuality {
...@@ -76,6 +77,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) { ...@@ -76,6 +77,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
let radialSegments = defaults(props.radialSegments, 12) let radialSegments = defaults(props.radialSegments, 12)
let linearSegments = defaults(props.linearSegments, 8) let linearSegments = defaults(props.linearSegments, 8)
let resolution = defaults(props.resolution, 2) let resolution = defaults(props.resolution, 2)
let doubleSided = defaults(props.doubleSided, true)
if (quality === 'auto' && data instanceof Structure) { if (quality === 'auto' && data instanceof Structure) {
quality = getStructureQuality(data.root) quality = getStructureQuality(data.root)
...@@ -87,42 +89,49 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) { ...@@ -87,42 +89,49 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
radialSegments = 36 radialSegments = 36
linearSegments = 18 linearSegments = 18
resolution = 0.1 resolution = 0.1
doubleSided = true
break break
case 'higher': case 'higher':
detail = 3 detail = 3
radialSegments = 28 radialSegments = 28
linearSegments = 14 linearSegments = 14
resolution = 0.3 resolution = 0.3
doubleSided = true
break break
case 'high': case 'high':
detail = 2 detail = 2
radialSegments = 20 radialSegments = 20
linearSegments = 10 linearSegments = 10
resolution = 0.5 resolution = 0.5
doubleSided = true
break break
case 'medium': case 'medium':
detail = 1 detail = 1
radialSegments = 12 radialSegments = 12
linearSegments = 8 linearSegments = 8
resolution = 1 resolution = 1
doubleSided = true
break break
case 'low': case 'low':
detail = 0 detail = 0
radialSegments = 8 radialSegments = 8
linearSegments = 3 linearSegments = 3
resolution = 2 resolution = 2
doubleSided = false
break break
case 'lower': case 'lower':
detail = 0 detail = 0
radialSegments = 4 radialSegments = 4
linearSegments = 2 linearSegments = 2
resolution = 4 resolution = 4
doubleSided = false
break break
case 'lowest': case 'lowest':
detail = 0 detail = 0
radialSegments = 2 radialSegments = 2
linearSegments = 1 linearSegments = 1
resolution = 8 resolution = 8
doubleSided = false
break break
case 'custom': case 'custom':
// use defaults or given props as set above // use defaults or given props as set above
...@@ -133,6 +142,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) { ...@@ -133,6 +142,7 @@ export function getQualityProps(props: Partial<QualityProps>, data?: any) {
detail, detail,
radialSegments, radialSegments,
linearSegments, linearSegments,
resolution resolution,
doubleSided
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment