bimplus-renderer 1.8.30-jquery-update2-01 → 1.8.30-textures-01

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.
@@ -1,38 +1,38 @@
1
- # Moment Timezone Integration
2
-
3
- The `setSunPosition` function now supports optional moment-timezone integration. Here are the different ways to use it:
4
-
5
- ## Inject programmatically
6
-
7
- ```javascript
8
- import { injectMomentTimezone, hasMomentTimezone } from 'bimplus-renderer';
9
-
10
- // If you have moment-timezone available in your application
11
- import moment from 'moment-timezone';
12
-
13
- // You can check if moment-timezone is available before calling the function:
14
- if (!hasMomentTimezone()) {
15
- console.log('Injecting moment-timezone for sun positioning features');
16
- injectMomentTimezone(moment);
17
- }
18
-
19
- // Now you can use setSunPosition
20
- viewport3D.setSunPosition({
21
- northDirection: 0,
22
- year: 2024,
23
- month: 6,
24
- day: 21,
25
- hours: 12,
26
- minutes: 0,
27
- timezone: 'Europe/Berlin',
28
- latitude: 52.5200,
29
- longitude: 13.4050,
30
- showSky: true
31
- });
32
- ```
33
-
34
- This approach allows:
35
- - Backward compatibility for existing users who have moment-timezone
36
- - Forward compatibility for new users who don't want the dependency
37
- - Clear error messages when the functionality is used without the required library
1
+ # Moment Timezone Integration
2
+
3
+ The `setSunPosition` function now supports optional moment-timezone integration. Here are the different ways to use it:
4
+
5
+ ## Inject programmatically
6
+
7
+ ```javascript
8
+ import { injectMomentTimezone, hasMomentTimezone } from 'bimplus-renderer';
9
+
10
+ // If you have moment-timezone available in your application
11
+ import moment from 'moment-timezone';
12
+
13
+ // You can check if moment-timezone is available before calling the function:
14
+ if (!hasMomentTimezone()) {
15
+ console.log('Injecting moment-timezone for sun positioning features');
16
+ injectMomentTimezone(moment);
17
+ }
18
+
19
+ // Now you can use setSunPosition
20
+ viewport3D.setSunPosition({
21
+ northDirection: 0,
22
+ year: 2024,
23
+ month: 6,
24
+ day: 21,
25
+ hours: 12,
26
+ minutes: 0,
27
+ timezone: 'Europe/Berlin',
28
+ latitude: 52.5200,
29
+ longitude: 13.4050,
30
+ showSky: true
31
+ });
32
+ ```
33
+
34
+ This approach allows:
35
+ - Backward compatibility for existing users who have moment-timezone
36
+ - Forward compatibility for new users who don't want the dependency
37
+ - Clear error messages when the functionality is used without the required library
38
38
  - Flexibility in how the library is provided (npm, CDN, injection)
@@ -1,64 +1,64 @@
1
- # Test-Only Moment-Timezone Integration
2
-
3
- ## Overview
4
-
5
- This solution successfully implements moment-timezone dependency injection specifically for tests while keeping the production code completely free of the dependency.
6
-
7
- ## Implementation
8
-
9
- ### 1. Production Code (Optional Dependency)
10
- - **[src/viewport3d.js](src/viewport3d.js)**: Contains optional moment-timezone detection
11
- - **[src/utils/momentTimezoneInjector.js](src/utils/momentTimezoneInjector.js)**: Utility for external injection (for BimExplorer app)
12
- - Production builds work without moment-timezone installed
13
- - Runtime errors provide clear instructions when moment-timezone features are needed
14
-
15
- ### 2. Test-Only Injection
16
- - **[test/setup/momentTimezoneInjector.js](test/setup/momentTimezoneInjector.js)**: Test setup that injects moment-timezone globally
17
- - **package.json**: moment-timezone installed as `devDependency` only
18
- - **karma-files-config.js**: Loads injector before any test files
19
-
20
- ### 3. Test Configuration
21
- ```javascript
22
- // In karma-files-config.js
23
- files: [
24
- "src/**/*.js",
25
- // Load test environment setup (inject moment-timezone for tests)
26
- "test/setup/momentTimezoneInjector.js",
27
- // Load custom assertions first
28
- "test/customAsserts.js",
29
- // Load test files
30
- "test/**/*.js",
31
- ],
32
- ```
33
-
34
- ## How It Works
35
-
36
- ### For Tests
37
- 1. Karma loads the moment-timezone injector first
38
- 2. The injector imports moment-timezone (available as dev dependency)
39
- 3. Injects it into global scope (`window.moment`)
40
- 4. All tests run with moment-timezone available
41
- 5. Sun calculation tests pass with accurate timezone handling
42
-
43
- ### For Production
44
- 1. Production code uses optional detection: `getMomentTZ()`
45
- 2. If moment-timezone isn't found, production code either:
46
- - Throws descriptive error for features requiring it (`setSunPosition`)
47
- 3. Build process excludes moment-timezone from production bundle
48
- 4. Users can inject moment-timezone via BimExplorer app if needed
49
-
50
- ## File Changes
51
-
52
- ### New Files
53
- - `test/setup/momentTimezoneInjector.js` - Test environment setup
54
-
55
- ### Modified Files
56
- - `karma-files-config.js` - Added test setup loader
57
- - `package.json` - Added moment-timezone as devDependency
58
-
59
- ### Existing Files (Unchanged)
60
- - `src/viewport3d.js` - Already has optional moment-timezone detection
61
- - `src/utils/momentTimezoneInjector.js` - Already provides injection utilities
62
- - All test files - Work seamlessly with injected moment-timezone
63
-
1
+ # Test-Only Moment-Timezone Integration
2
+
3
+ ## Overview
4
+
5
+ This solution successfully implements moment-timezone dependency injection specifically for tests while keeping the production code completely free of the dependency.
6
+
7
+ ## Implementation
8
+
9
+ ### 1. Production Code (Optional Dependency)
10
+ - **[src/viewport3d.js](src/viewport3d.js)**: Contains optional moment-timezone detection
11
+ - **[src/utils/momentTimezoneInjector.js](src/utils/momentTimezoneInjector.js)**: Utility for external injection (for BimExplorer app)
12
+ - Production builds work without moment-timezone installed
13
+ - Runtime errors provide clear instructions when moment-timezone features are needed
14
+
15
+ ### 2. Test-Only Injection
16
+ - **[test/setup/momentTimezoneInjector.js](test/setup/momentTimezoneInjector.js)**: Test setup that injects moment-timezone globally
17
+ - **package.json**: moment-timezone installed as `devDependency` only
18
+ - **karma-files-config.js**: Loads injector before any test files
19
+
20
+ ### 3. Test Configuration
21
+ ```javascript
22
+ // In karma-files-config.js
23
+ files: [
24
+ "src/**/*.js",
25
+ // Load test environment setup (inject moment-timezone for tests)
26
+ "test/setup/momentTimezoneInjector.js",
27
+ // Load custom assertions first
28
+ "test/customAsserts.js",
29
+ // Load test files
30
+ "test/**/*.js",
31
+ ],
32
+ ```
33
+
34
+ ## How It Works
35
+
36
+ ### For Tests
37
+ 1. Karma loads the moment-timezone injector first
38
+ 2. The injector imports moment-timezone (available as dev dependency)
39
+ 3. Injects it into global scope (`window.moment`)
40
+ 4. All tests run with moment-timezone available
41
+ 5. Sun calculation tests pass with accurate timezone handling
42
+
43
+ ### For Production
44
+ 1. Production code uses optional detection: `getMomentTZ()`
45
+ 2. If moment-timezone isn't found, production code either:
46
+ - Throws descriptive error for features requiring it (`setSunPosition`)
47
+ 3. Build process excludes moment-timezone from production bundle
48
+ 4. Users can inject moment-timezone via BimExplorer app if needed
49
+
50
+ ## File Changes
51
+
52
+ ### New Files
53
+ - `test/setup/momentTimezoneInjector.js` - Test environment setup
54
+
55
+ ### Modified Files
56
+ - `karma-files-config.js` - Added test setup loader
57
+ - `package.json` - Added moment-timezone as devDependency
58
+
59
+ ### Existing Files (Unchanged)
60
+ - `src/viewport3d.js` - Already has optional moment-timezone detection
61
+ - `src/utils/momentTimezoneInjector.js` - Already provides injection utilities
62
+ - All test files - Work seamlessly with injected moment-timezone
63
+
64
64
  This solution provides the best of both worlds: comprehensive test coverage with accurate timezone calculations, while maintaining a lean production build without unnecessary dependencies.
package/README.md CHANGED
@@ -1,124 +1,124 @@
1
- bim+ renderer
2
- =========
3
-
4
- bim+ renderer is a javascript renderer core based on three js.
5
-
6
- Quick Links
7
- -----------
8
-
9
- https://nemetschekprime.atlassian.net/wiki/spaces/bimpluspublic/pages/1090127443/Bimplus+Renderer+Reference
10
-
11
- How to build
12
- ------------
13
-
14
- ### Install nodejs
15
- [http://www.nodejs.org/](http://www.nodejs.org/)
16
-
17
- ### Install local npm modules
18
- Open up a normal command line (admin is not needed) and go to the renderer folder
19
-
20
- npm install
21
-
22
- (whenever package.json has changed, you might to do this again)
23
-
24
- ### Install emscripten SDK
25
- [https://emscripten.org/](https://emscripten.org/)
26
- Install the emscripten toolchain to cross compile the performance critical parts written
27
- in c/c++ to web assembly
28
-
29
- ### Build renderer
30
- Library building process is using UMD (Universal Module Definition) output format so
31
- it's compatible with both cjs and amd module formats. The same library can be use in the
32
- client or on the server. Build process is using babel so it's possible to use new ES2015
33
- code in source codes.
34
-
35
- Library can be build in several ways as a dev or prod version.
36
- To run a dev build with source maps run:
37
-
38
- npm run build
39
-
40
- To build a prod version - uglified, minified run:
41
-
42
- npm run build-prod
43
-
44
- Pulish new release to npm (Hint: Before doing this npm login needs to be done and the package version adjusted) :
45
-
46
- npm run npm-publish
47
-
48
- Check content of npm package (result is bimplus-renderer@(version).tar.gz)
49
-
50
- npm run npm-pack
51
-
52
- ### Develop/Debug renderer
53
- goto your renderer folder
54
-
55
- npm link
56
-
57
- goto your application folder which uses the renderer
58
-
59
- npm link bimplus-renderer
60
-
61
- Do you changes in the renderer and build
62
-
63
- npm run build
64
-
65
- or
66
-
67
- grunt run build-prod
68
-
69
- Your app will automatically get the changes done in the renderer
70
-
71
- After developing it might be wise to unlink:
72
- goto your renderer folder
73
-
74
- npm unlink
75
-
76
- goto your application folder which uses the renderer
77
-
78
- npm unlink bimplus-renderer
79
- npm install
80
-
81
- ### Unit testing
82
- With every build output is copied also to the test folder.
83
- To run the unit tests go to the test subfolder and run
84
-
85
- npm install
86
- npm run test
87
-
88
- ### Documentation
89
- Bimplus WebSDK uses npm documentation plugin for easy documentation generation.
90
- To generate a documentation please install documentation plugin via npm :
91
-
92
- npm install -g documentation
93
-
94
- To create documentation in html format go to your renderer folder and run :
95
-
96
- npm run build-doc
97
-
98
- Documentation output will be in renderer/documentation folder
99
-
100
- To create documentation in markdown format go to your renderer folder and run :
101
-
102
- npm run build-docMd
103
-
104
- Documentation output will be in renderer/documentation/Bimplus_Renderer_doc.md file.
105
-
106
- To create a markdown suitable for Confluence run script:
107
-
108
- npm run build-docConf
109
-
110
- Please note that python must be installed !!
111
- This script will convert generated markdown into Confluence format. See console
112
- output for converted file name. Default place is in ./documentation in file :
113
- Bimplus_Renderer_doc_confluence.md
114
-
115
-
116
- Content of the confluence file can be inserted into Confluence page :
117
- - start confluence page editation mode
118
- - choose Insert more content / {} Markup option from toolbar
119
- - in popup window choose to Insert Markdown format
120
- - copy content of the converted confluence markdown file into the field in Confluence
121
- - save it (Please note that page links doesn't work in page preview mode)
122
-
123
- ### Typescript definitions
124
- - typescript definition file is located in subfolder 'types'
1
+ bim+ renderer
2
+ =========
3
+
4
+ bim+ renderer is a javascript renderer core based on three js.
5
+
6
+ Quick Links
7
+ -----------
8
+
9
+ https://nemetschekprime.atlassian.net/wiki/spaces/bimpluspublic/pages/1090127443/Bimplus+Renderer+Reference
10
+
11
+ How to build
12
+ ------------
13
+
14
+ ### Install nodejs
15
+ [http://www.nodejs.org/](http://www.nodejs.org/)
16
+
17
+ ### Install local npm modules
18
+ Open up a normal command line (admin is not needed) and go to the renderer folder
19
+
20
+ npm install
21
+
22
+ (whenever package.json has changed, you might to do this again)
23
+
24
+ ### Install emscripten SDK
25
+ [https://emscripten.org/](https://emscripten.org/)
26
+ Install the emscripten toolchain to cross compile the performance critical parts written
27
+ in c/c++ to web assembly
28
+
29
+ ### Build renderer
30
+ Library building process is using UMD (Universal Module Definition) output format so
31
+ it's compatible with both cjs and amd module formats. The same library can be use in the
32
+ client or on the server. Build process is using babel so it's possible to use new ES2015
33
+ code in source codes.
34
+
35
+ Library can be build in several ways as a dev or prod version.
36
+ To run a dev build with source maps run:
37
+
38
+ npm run build
39
+
40
+ To build a prod version - uglified, minified run:
41
+
42
+ npm run build-prod
43
+
44
+ Pulish new release to npm (Hint: Before doing this npm login needs to be done and the package version adjusted) :
45
+
46
+ npm run npm-publish
47
+
48
+ Check content of npm package (result is bimplus-renderer@(version).tar.gz)
49
+
50
+ npm run npm-pack
51
+
52
+ ### Develop/Debug renderer
53
+ goto your renderer folder
54
+
55
+ npm link
56
+
57
+ goto your application folder which uses the renderer
58
+
59
+ npm link bimplus-renderer
60
+
61
+ Do you changes in the renderer and build
62
+
63
+ npm run build
64
+
65
+ or
66
+
67
+ grunt run build-prod
68
+
69
+ Your app will automatically get the changes done in the renderer
70
+
71
+ After developing it might be wise to unlink:
72
+ goto your renderer folder
73
+
74
+ npm unlink
75
+
76
+ goto your application folder which uses the renderer
77
+
78
+ npm unlink bimplus-renderer
79
+ npm install
80
+
81
+ ### Unit testing
82
+ With every build output is copied also to the test folder.
83
+ To run the unit tests go to the test subfolder and run
84
+
85
+ npm install
86
+ npm run test
87
+
88
+ ### Documentation
89
+ Bimplus WebSDK uses npm documentation plugin for easy documentation generation.
90
+ To generate a documentation please install documentation plugin via npm :
91
+
92
+ npm install -g documentation
93
+
94
+ To create documentation in html format go to your renderer folder and run :
95
+
96
+ npm run build-doc
97
+
98
+ Documentation output will be in renderer/documentation folder
99
+
100
+ To create documentation in markdown format go to your renderer folder and run :
101
+
102
+ npm run build-docMd
103
+
104
+ Documentation output will be in renderer/documentation/Bimplus_Renderer_doc.md file.
105
+
106
+ To create a markdown suitable for Confluence run script:
107
+
108
+ npm run build-docConf
109
+
110
+ Please note that python must be installed !!
111
+ This script will convert generated markdown into Confluence format. See console
112
+ output for converted file name. Default place is in ./documentation in file :
113
+ Bimplus_Renderer_doc_confluence.md
114
+
115
+
116
+ Content of the confluence file can be inserted into Confluence page :
117
+ - start confluence page editation mode
118
+ - choose Insert more content / {} Markup option from toolbar
119
+ - in popup window choose to Insert Markdown format
120
+ - copy content of the converted confluence markdown file into the field in Confluence
121
+ - save it (Please note that page links doesn't work in page preview mode)
122
+
123
+ ### Typescript definitions
124
+ - typescript definition file is located in subfolder 'types'
@@ -1,41 +1,41 @@
1
- emcc for webassemblies
2
- ======================
3
-
4
- Python installation
5
- -------------------
6
- Installation of python. On windows the best way is to open a powershell and type python. When python isn't installed a window is opened and python can be installed from webstore
7
-
8
- After finished installation check installed python version in cmd or powershell
9
-
10
- PS H:\> python --version
11
- Python 3.8.6
12
-
13
- Installation Emscripten
14
- -----------------------
15
- Install the emcc sdk.
16
- Good description could be found here
17
-
18
- https://www.tutorialspoint.com/webassembly/webassembly_installation.htm
19
-
20
- Create some folder like C:\wa or C:\wa-emcc and clone the sdk inside this folder
21
-
22
- Building Bimplus-Render
23
- -----------------------
24
- Add path information to systemvariables (Used installation folder for emcc like D:\wa-emcc\)
25
-
26
- D:\wa-emcc\emsdk
27
- D:\wa-emcc\emsdk\upstream\emscripten
28
- D:\wa-emcc\emsdk\node\12.18.1_64bit\bin
29
- D:\wa-emcc\emsdk\python\3.7.4-pywin32_64bit
30
- D:\wa-emcc\emsdk\java\8.152_64bit\bin;
31
-
32
- ### Output of emcc is generated in bin folder
33
- The
34
-
35
- bin\
36
-
37
- folder is needed for
38
-
39
- npm run build
40
-
41
- so we have excluded this file from .gitignore
1
+ emcc for webassemblies
2
+ ======================
3
+
4
+ Python installation
5
+ -------------------
6
+ Installation of python. On windows the best way is to open a powershell and type python. When python isn't installed a window is opened and python can be installed from webstore
7
+
8
+ After finished installation check installed python version in cmd or powershell
9
+
10
+ PS H:\> python --version
11
+ Python 3.8.6
12
+
13
+ Installation Emscripten
14
+ -----------------------
15
+ Install the emcc sdk.
16
+ Good description could be found here
17
+
18
+ https://www.tutorialspoint.com/webassembly/webassembly_installation.htm
19
+
20
+ Create some folder like C:\wa or C:\wa-emcc and clone the sdk inside this folder
21
+
22
+ Building Bimplus-Render
23
+ -----------------------
24
+ Add path information to systemvariables (Used installation folder for emcc like D:\wa-emcc\)
25
+
26
+ D:\wa-emcc\emsdk
27
+ D:\wa-emcc\emsdk\upstream\emscripten
28
+ D:\wa-emcc\emsdk\node\12.18.1_64bit\bin
29
+ D:\wa-emcc\emsdk\python\3.7.4-pywin32_64bit
30
+ D:\wa-emcc\emsdk\java\8.152_64bit\bin;
31
+
32
+ ### Output of emcc is generated in bin folder
33
+ The
34
+
35
+ bin\
36
+
37
+ folder is needed for
38
+
39
+ npm run build
40
+
41
+ so we have excluded this file from .gitignore