Skip to content
Shapemetry

@huukhanhnguyen/types / model/environment

model/environment

Environment

Environment = { groundColor?: string; hdri?: EnvironmentHdri; moment?: SunMoment; site?: Site; skyColor?: string; skyLux?: number; sunKelvin?: number; sunLux?: number; }

settings.environment — the surroundings the model is lit by. Every field optional: a document with no environment is lit by its own emitting objects and nothing else.

groundColor?

optional groundColor?: string

Colour bounced from below (−Z) — the ground half. Equal to skyColor gives the flat uniform fill a renderer calls "ambient".

hdri?

optional hdri?: EnvironmentHdri

moment?

optional moment?: SunMoment

Which moment — the sun's second input. Without both, there is no sun.

site?

optional site?: Site

Where on Earth — the sun's first input.

skyColor?

optional skyColor?: string

Colour arriving from above (+Z) — the sky half of the outdoor bounce.

skyLux?

optional skyLux?: number

Illuminance (lux) of that sky/ground fill.

sunKelvin?

optional sunKelvin?: number

Sun colour temperature (K).

sunLux?

optional sunLux?: number

Direct-sun illuminance (lux) at the model. Absent = a bright clear midday (the host's documented default).


EnvironmentHdri

EnvironmentHdri = { intensity?: number; name?: string; }

Image-based lighting. name is a url-method parameter key (an attached HDRI bitmap is an ordinary parameter whose value is its URL) OR a direct https:/data: URI; absent = the host's neutral built-in room, so PBR materials are not pitch black before an HDRI is authored.

intensity?

optional intensity?: number

name?

optional name?: string


Site

Site = { latitude: number; longitude: number; northAngle?: number; }

Where the model stands on Earth. northAngle rotates project north away from +Y, in degrees counter-clockwise looking down. Revit's project location / SketchUp's geo-locate.

latitude

latitude: number

longitude

longitude: number

northAngle?

optional northAngle?: number


SunMoment

SunMoment = { day: number; hour: number; month: number; }

The moment the sun is computed for — a document FACT (which day and hour this shadow study is about), not a clock reading: nothing here ever consults the wall clock, so the same document always produces the same shadows.

hour is LOCAL SOLAR time (12 = the sun crossing the site's meridian): shadow studies are authored against solar noon, so longitude/time-zone conversion is deliberately out of scope.

day

day: number

hour

hour: number

month

month: number

Last updated: 📖 2 min readEdit on GitHub