@meteo-render/mars3d 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/index.cjs +7 -0
- package/dist/index.mjs +7 -0
- package/dist/index.umd.js +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/raster-mars3d/cesiumRasterPlaneRenderer.d.ts +28 -0
- package/dist/types/raster-mars3d/cesiumRasterTextureAdapter.d.ts +14 -0
- package/dist/types/raster-mars3d/index.d.ts +6 -0
- package/dist/types/raster-mars3d/mars3dRasterImageryProvider.d.ts +30 -0
- package/dist/types/raster-mars3d/mars3dRasterPlaneLayer.d.ts +3 -0
- package/dist/types/raster-mars3d/rasterPlaneCesiumTypes.d.ts +95 -0
- package/dist/types/raster-mars3d/rasterPlaneGeometry.d.ts +5 -0
- package/dist/types/raster-mars3d/rasterPlaneGridChunks.d.ts +4 -0
- package/dist/types/raster-mars3d/rasterPlaneMaterial.d.ts +21 -0
- package/dist/types/raster-mars3d/rasterPlaneTypes.d.ts +33 -0
- package/dist/types/raster-mars3d/types.d.ts +30 -0
- package/dist/types/volume-mars3d/createMars3dVolumeScene.d.ts +3 -0
- package/dist/types/volume-mars3d/index.d.ts +2 -0
- package/dist/types/volume-mars3d/mars3dCanvasCompensation.d.ts +22 -0
- package/dist/types/volume-mars3d/mars3dRaymarchShader.d.ts +1 -0
- package/dist/types/volume-mars3d/mars3dVolumeLayer.d.ts +2 -0
- package/dist/types/volume-mars3d/mars3dVolumeRenderer.d.ts +56 -0
- package/dist/types/volume-mars3d/volumeMars3dTypes.d.ts +85 -0
- package/dist/types/volume-mars3d-native/index.d.ts +4 -0
- package/dist/types/volume-mars3d-native/liveUpdateScheduler.d.ts +10 -0
- package/dist/types/volume-mars3d-native/mars3dNativeSliceLayer.d.ts +2 -0
- package/dist/types/volume-mars3d-native/mars3dNativeSliceRenderer.d.ts +56 -0
- package/dist/types/volume-mars3d-native/mars3dNativeVolumeLayer.d.ts +2 -0
- package/dist/types/volume-mars3d-native/mars3dNativeVolumeRenderer.d.ts +34 -0
- package/dist/types/volume-mars3d-native/nativeAxisSliceRenderer.d.ts +40 -0
- package/dist/types/volume-mars3d-native/nativeSliceAtlas.d.ts +50 -0
- package/dist/types/volume-mars3d-native/nativeSliceRuntimeTypes.d.ts +17 -0
- package/dist/types/volume-mars3d-native/nativeTypes.d.ts +174 -0
- package/dist/types/volume-mars3d-native/nativeVoxelProvider.d.ts +6 -0
- package/dist/types/volume-mars3d-native/nativeVoxelShader.d.ts +2 -0
- package/dist/types/volume-mars3d-native/voxelData.d.ts +9 -0
- package/package.json +60 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { IVolumeOpacityStop, VolumeColorMode, VolumeColorStopInput } from '@meteo-render/volume';
|
|
2
|
+
import type { VolumeSliceAxis } from '@meteo-render/volume';
|
|
3
|
+
import type { IVolumeAxis } from '@meteo-render/volume';
|
|
4
|
+
import type { INativeVoxelData } from './voxelData';
|
|
5
|
+
export interface INativeSliceAtlasLayer {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
uMinimum: number;
|
|
11
|
+
uMaximum: number;
|
|
12
|
+
vMinimum: number;
|
|
13
|
+
vMaximum: number;
|
|
14
|
+
contentBounds?: INativeSliceContentBounds | null;
|
|
15
|
+
}
|
|
16
|
+
export interface INativeSliceContentBounds {
|
|
17
|
+
west: number;
|
|
18
|
+
south: number;
|
|
19
|
+
east: number;
|
|
20
|
+
north: number;
|
|
21
|
+
}
|
|
22
|
+
export interface INativeSliceAtlasLayout {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
columns: number;
|
|
26
|
+
rows: number;
|
|
27
|
+
layers: readonly INativeSliceAtlasLayer[];
|
|
28
|
+
}
|
|
29
|
+
export interface INativeSliceAtlasOptions {
|
|
30
|
+
layerWidth: number;
|
|
31
|
+
layerHeight: number;
|
|
32
|
+
colorStops: readonly VolumeColorStopInput[];
|
|
33
|
+
opacityStops: readonly IVolumeOpacityStop[];
|
|
34
|
+
colorMode: VolumeColorMode;
|
|
35
|
+
}
|
|
36
|
+
export interface INativeSliceAtlas {
|
|
37
|
+
layout: INativeSliceAtlasLayout;
|
|
38
|
+
pixels: Uint8ClampedArray;
|
|
39
|
+
}
|
|
40
|
+
export interface INativeAxisSliceImage {
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
pixels: Uint8ClampedArray;
|
|
44
|
+
}
|
|
45
|
+
type NativeTransferOptions = Pick<INativeSliceAtlasOptions, 'colorStops' | 'opacityStops' | 'colorMode'>;
|
|
46
|
+
export declare const nativeAxisPositionToIndex: (axis: IVolumeAxis, position: number) => number;
|
|
47
|
+
export declare const createNativeSliceAtlasLayout: (layerCount: number, layerWidth: number, layerHeight: number, padding?: number) => INativeSliceAtlasLayout;
|
|
48
|
+
export declare const createNativeSliceAtlas: (data: INativeVoxelData, options: INativeSliceAtlasOptions) => INativeSliceAtlas;
|
|
49
|
+
export declare const createNativeAxisSliceImage: (data: INativeVoxelData, axis: VolumeSliceAxis, index: number, options: NativeTransferOptions) => INativeAxisSliceImage;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ICesiumNativeRuntime } from './nativeTypes';
|
|
2
|
+
interface ICesiumMaterialSupportLike {
|
|
3
|
+
readonly vertexFormat: unknown;
|
|
4
|
+
}
|
|
5
|
+
interface ICesiumMaterialAppearanceConstructor {
|
|
6
|
+
new (options?: Record<string, unknown>): unknown;
|
|
7
|
+
readonly MaterialSupport: {
|
|
8
|
+
readonly TEXTURED: ICesiumMaterialSupportLike;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface INativeSliceCesiumRuntime extends ICesiumNativeRuntime {
|
|
12
|
+
readonly WallGeometry: {
|
|
13
|
+
fromConstantHeights(options: Record<string, unknown>): unknown;
|
|
14
|
+
};
|
|
15
|
+
readonly MaterialAppearance: ICesiumMaterialAppearanceConstructor;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { IVolumeSource } from '@meteo-render/volume';
|
|
2
|
+
import type { IVolumeOpacityStop, VolumeColorMode, VolumeColorStopInput } from '@meteo-render/volume';
|
|
3
|
+
import type { VolumeQualityPreset } from '@meteo-render/volume';
|
|
4
|
+
import type { IVolumeLockedSlice, VolumeSliceAxis } from '@meteo-render/volume';
|
|
5
|
+
export interface IMars3dNativeVolumeLayerOptions {
|
|
6
|
+
source: IVolumeSource;
|
|
7
|
+
colorStops: readonly VolumeColorStopInput[];
|
|
8
|
+
opacityStops: readonly IVolumeOpacityStop[];
|
|
9
|
+
timeIndex?: number;
|
|
10
|
+
quality?: VolumeQualityPreset;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
densityScale?: number;
|
|
13
|
+
verticalScale?: number;
|
|
14
|
+
colorMode?: VolumeColorMode;
|
|
15
|
+
name?: string;
|
|
16
|
+
show?: boolean;
|
|
17
|
+
onError?: (error: Error) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface IMars3dNativeVolumeLayerUpdate {
|
|
20
|
+
quality?: VolumeQualityPreset;
|
|
21
|
+
opacity?: number;
|
|
22
|
+
densityScale?: number;
|
|
23
|
+
verticalScale?: number;
|
|
24
|
+
colorStops?: readonly VolumeColorStopInput[];
|
|
25
|
+
opacityStops?: readonly IVolumeOpacityStop[];
|
|
26
|
+
colorMode?: VolumeColorMode;
|
|
27
|
+
}
|
|
28
|
+
export interface INativeVolumeStatistics {
|
|
29
|
+
texturesByteLength: number;
|
|
30
|
+
visited: number;
|
|
31
|
+
numberOfTilesWithContentReady: number;
|
|
32
|
+
}
|
|
33
|
+
export interface IMars3dNativeVolumeLayer {
|
|
34
|
+
readonly readyPromise: Promise<void>;
|
|
35
|
+
readonly statistics: INativeVolumeStatistics | null;
|
|
36
|
+
update(options: IMars3dNativeVolumeLayerUpdate): void;
|
|
37
|
+
setSource(source: IVolumeSource): Promise<void>;
|
|
38
|
+
setTimeIndex(timeIndex: number): Promise<void>;
|
|
39
|
+
destroy(noDel?: boolean): void;
|
|
40
|
+
}
|
|
41
|
+
export interface IMars3dNativeSliceVolumeLayer extends IMars3dNativeVolumeLayer {
|
|
42
|
+
readonly lockedSlices: readonly IVolumeLockedSlice[];
|
|
43
|
+
lockSlice(axis: VolumeSliceAxis, position: number): IVolumeLockedSlice;
|
|
44
|
+
updateSlice(id: string, position: number): void;
|
|
45
|
+
removeSlice(id: string): void;
|
|
46
|
+
clearLockedSlices(): void;
|
|
47
|
+
}
|
|
48
|
+
export interface ICesiumCartesian3Like {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
z: number;
|
|
52
|
+
}
|
|
53
|
+
export interface ICesiumEventLike {
|
|
54
|
+
addEventListener(listener: () => void): () => void;
|
|
55
|
+
}
|
|
56
|
+
export interface ICesiumCustomShaderLike {
|
|
57
|
+
setUniform(name: string, value: number): void;
|
|
58
|
+
destroy(): void;
|
|
59
|
+
}
|
|
60
|
+
export interface ICesiumVoxelPrimitiveLike {
|
|
61
|
+
show: boolean;
|
|
62
|
+
stepSize: number;
|
|
63
|
+
screenSpaceError: number;
|
|
64
|
+
depthTest: boolean;
|
|
65
|
+
nearestSampling: boolean;
|
|
66
|
+
minBounds: ICesiumCartesian3Like;
|
|
67
|
+
maxBounds: ICesiumCartesian3Like;
|
|
68
|
+
customShader: ICesiumCustomShaderLike;
|
|
69
|
+
readonly ready: boolean;
|
|
70
|
+
readonly initialTilesLoaded: ICesiumEventLike;
|
|
71
|
+
readonly statistics?: Partial<INativeVolumeStatistics>;
|
|
72
|
+
}
|
|
73
|
+
export interface ICesiumSliceGeometryLike {
|
|
74
|
+
readonly attributes: {
|
|
75
|
+
readonly st?: {
|
|
76
|
+
readonly values: Float32Array;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export interface ICesiumMaterialLike {
|
|
81
|
+
readonly uniforms: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export interface ICesiumSlicePrimitiveLike {
|
|
84
|
+
show: boolean;
|
|
85
|
+
readonly ready: boolean;
|
|
86
|
+
}
|
|
87
|
+
export interface ICesiumPrimitiveCollectionLike {
|
|
88
|
+
add<T>(primitive: T): T;
|
|
89
|
+
remove(primitive: unknown): boolean;
|
|
90
|
+
}
|
|
91
|
+
export interface ICesiumSceneLike {
|
|
92
|
+
readonly primitives: ICesiumPrimitiveCollectionLike;
|
|
93
|
+
readonly postRender: ICesiumEventLike;
|
|
94
|
+
requestRender(): void;
|
|
95
|
+
}
|
|
96
|
+
export interface IMars3dNativeMapLike {
|
|
97
|
+
readonly scene: ICesiumSceneLike;
|
|
98
|
+
}
|
|
99
|
+
export interface IMars3dNativeBaseLayerLike {
|
|
100
|
+
readonly _map?: IMars3dNativeMapLike;
|
|
101
|
+
show: boolean;
|
|
102
|
+
destroy(noDel?: boolean): void;
|
|
103
|
+
}
|
|
104
|
+
export interface IMars3dNativeRuntime {
|
|
105
|
+
readonly layer: {
|
|
106
|
+
readonly BaseLayer: new (options?: unknown) => IMars3dNativeBaseLayerLike;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface ICesiumConstructor<T, TOptions = unknown> {
|
|
110
|
+
new (options: TOptions): T;
|
|
111
|
+
}
|
|
112
|
+
export interface ICesiumNativeRuntime {
|
|
113
|
+
readonly Cartesian3: {
|
|
114
|
+
new (x?: number, y?: number, z?: number): ICesiumCartesian3Like;
|
|
115
|
+
fromRadians(longitude: number, latitude: number, height?: number): ICesiumCartesian3Like;
|
|
116
|
+
};
|
|
117
|
+
readonly Ellipsoid: {
|
|
118
|
+
readonly WGS84: {
|
|
119
|
+
readonly radii: ICesiumCartesian3Like;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
readonly Matrix4: {
|
|
123
|
+
readonly IDENTITY: unknown;
|
|
124
|
+
fromScale(scale: ICesiumCartesian3Like): unknown;
|
|
125
|
+
};
|
|
126
|
+
readonly VoxelShapeType: {
|
|
127
|
+
readonly ELLIPSOID: unknown;
|
|
128
|
+
};
|
|
129
|
+
readonly MetadataType: {
|
|
130
|
+
readonly SCALAR: unknown;
|
|
131
|
+
};
|
|
132
|
+
readonly MetadataComponentType: {
|
|
133
|
+
readonly FLOAT32: unknown;
|
|
134
|
+
readonly UINT8: unknown;
|
|
135
|
+
};
|
|
136
|
+
readonly VoxelContent: {
|
|
137
|
+
fromMetadataArray(values: readonly (Float32Array | Uint8Array)[]): unknown;
|
|
138
|
+
};
|
|
139
|
+
readonly UniformType: {
|
|
140
|
+
readonly FLOAT: unknown;
|
|
141
|
+
};
|
|
142
|
+
readonly LightingModel: {
|
|
143
|
+
readonly UNLIT: unknown;
|
|
144
|
+
};
|
|
145
|
+
readonly CustomShaderTranslucencyMode: {
|
|
146
|
+
readonly TRANSLUCENT: unknown;
|
|
147
|
+
};
|
|
148
|
+
readonly CustomShader: ICesiumConstructor<ICesiumCustomShaderLike, Record<string, unknown>>;
|
|
149
|
+
readonly VoxelPrimitive: ICesiumConstructor<ICesiumVoxelPrimitiveLike, Record<string, unknown>>;
|
|
150
|
+
readonly Rectangle: {
|
|
151
|
+
fromDegrees(west: number, south: number, east: number, north: number): unknown;
|
|
152
|
+
};
|
|
153
|
+
readonly RectangleGeometry: ICesiumConstructor<unknown, Record<string, unknown>> & {
|
|
154
|
+
createGeometry(geometry: unknown): ICesiumSliceGeometryLike | undefined;
|
|
155
|
+
};
|
|
156
|
+
readonly GeometryInstance: ICesiumConstructor<unknown, Record<string, unknown>>;
|
|
157
|
+
readonly Primitive: ICesiumConstructor<ICesiumSlicePrimitiveLike, Record<string, unknown>>;
|
|
158
|
+
readonly Material: ICesiumConstructor<ICesiumMaterialLike, Record<string, unknown>>;
|
|
159
|
+
readonly Color: ICesiumConstructor<unknown, {
|
|
160
|
+
red?: number;
|
|
161
|
+
green?: number;
|
|
162
|
+
blue?: number;
|
|
163
|
+
alpha?: number;
|
|
164
|
+
}> & {
|
|
165
|
+
new (red?: number, green?: number, blue?: number, alpha?: number): unknown;
|
|
166
|
+
};
|
|
167
|
+
readonly EllipsoidSurfaceAppearance: ICesiumConstructor<unknown, Record<string, unknown>> & {
|
|
168
|
+
readonly VERTEX_FORMAT: unknown;
|
|
169
|
+
};
|
|
170
|
+
readonly Math: {
|
|
171
|
+
toRadians(degrees: number): number;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IVolumeSource } from '@meteo-render/volume';
|
|
2
|
+
import type { ICesiumNativeRuntime } from './nativeTypes';
|
|
3
|
+
import type { INativeVoxelData } from './voxelData';
|
|
4
|
+
/** 按 Cesium 八叉树瓦片坐标从完整规则网格生成固定尺寸体素块。 */
|
|
5
|
+
export declare const createNativeVoxelTile: (data: INativeVoxelData, tileLevel: number, tileX: number, tileY: number, tileZ: number) => Uint8Array;
|
|
6
|
+
export declare const createNativeVoxelProvider: (cesium: ICesiumNativeRuntime, source: IVolumeSource, data: INativeVoxelData, verticalScale: number) => Record<string, unknown>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { IVolumeOpacityStop, VolumeColorMode, VolumeColorStopInput } from '@meteo-render/volume';
|
|
2
|
+
export declare const createNativeVoxelFragmentShader: (colorStops: readonly VolumeColorStopInput[], opacityStops: readonly IVolumeOpacityStop[], colorMode: VolumeColorMode) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IVolumeChunk, IVolumeSource } from '@meteo-render/volume';
|
|
2
|
+
export interface INativeVoxelData {
|
|
3
|
+
values: Uint8Array;
|
|
4
|
+
dimensions: readonly [number, number, number];
|
|
5
|
+
minimumValue: number;
|
|
6
|
+
maximumValue: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const normalizeNativeVoxelValues: (chunk: IVolumeChunk, source: IVolumeSource) => INativeVoxelData;
|
|
9
|
+
export declare const loadNativeVoxelData: (source: IVolumeSource, timeIndex: number, signal?: AbortSignal) => Promise<INativeVoxelData>;
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@meteo-render/mars3d",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Mars3D and Cesium adapters for meteo-render visualizations",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"module": "dist/index.mjs",
|
|
8
|
+
"browser": "dist/index.umd.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public",
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"obfuscate": "node ../../build/obfuscate.mjs",
|
|
22
|
+
"build": "npm run clean && npm run build:rolldown && npm run build:types && npm run obfuscate",
|
|
23
|
+
"prepack": "npm run build",
|
|
24
|
+
"clean": "esno scripts/clean.ts",
|
|
25
|
+
"build:rolldown": "rolldown -c rolldown.config.mjs",
|
|
26
|
+
"build:types": "tsc -p tsconfig.types.json"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [],
|
|
29
|
+
"author": "wangrl",
|
|
30
|
+
"license": "Apache-2.0",
|
|
31
|
+
"type": "module",
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"package.json"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@meteo-render/core": "^1.0.0",
|
|
38
|
+
"@meteo-render/raster": "^1.0.0",
|
|
39
|
+
"@meteo-render/rendering": "^1.0.0",
|
|
40
|
+
"@meteo-render/volume": "^1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@tsconfig/node24": "latest",
|
|
44
|
+
"@types/node": "latest",
|
|
45
|
+
"@webgpu/types": "0.1.71",
|
|
46
|
+
"esno": "latest",
|
|
47
|
+
"javascript-obfuscator": "latest",
|
|
48
|
+
"rolldown": "latest",
|
|
49
|
+
"typescript": "latest"
|
|
50
|
+
},
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/priestqing/meteo-render.git",
|
|
54
|
+
"directory": "packages/mars3d"
|
|
55
|
+
},
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/priestqing/meteo-render/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/priestqing/meteo-render#readme"
|
|
60
|
+
}
|