https://github.com/cityjson/cityjson-threejs-loader
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 4 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.0%) to scientific vocabulary
Keywords
Repository
Basic Info
Statistics
- Stars: 26
- Watchers: 4
- Forks: 17
- Open Issues: 5
- Releases: 0
Topics
Metadata Files
README.md
CityJSON three.js loader
A loader for CityJSON files in three.js.
Installation
Use in your project
yarn install git+https://github.com/cityjson/cityjson-threejs-loader.git
Development
- Clone this repository
- Run
yarn install - Go nuts!
Run examples
- Run
yarn run dev. - Visit http://localhost:9080/example/dev-bundle/index.html
- Drag 'n' drop any file to visualise it.
Use
You need to select one of the availables parsers (recommended is CityJSONWorkerParser) and use it with CityJSONLoader.
```JS import { CityJSONLoader, CityJSONWorkerParser } from 'cityjson-threejs-loader'
// Initialise your scene here
const parser = CityJSONWorkerParser();
const loader = CityJSONLoader( parser );
loader.load( cityjsonData );
scene.add( loader.scene ); ```
Raycasting the scene
The added scene objects contain functions to retrieve information related to the original city model when raycasting:
```JS // Initialise raycaster
const intersections = raycaster.intersectObject( loader.scene );
if ( intersection ) {
// Gain the 3D object that was hit by the closest ray
const object = intersection[ 0 ].object;
// Check if this is a city object
if ( object.isCityObject ) {
const data = object.resolveIntersectionInfo( intersection[ 0 ] )
const objectId = data.objectId; // This is the objectId of the city object hit by the ray
}
} ```
Visualization options
The scene objects have specialised materials to handle aspects of how the respective geometries are handled. For example:
```JS // Traverse the scene for objects scene.traverse( obj = > {
// Check if this has a material and if this is a city object material
if ( obj.material && obj.material.isCityObjectsMaterial ) {
obj.material.showSemantics = false; // This will disable coloring per semantic surface
}
} ); ```
Highlighting objects
City object materials can be used to highlight a specific object:
```JS // Assuming cityjsonData contains the citymodel and we want to highlight the selectObjectId const objectIndex = Object.keys( cityjsonData.CityObjects ).indexOf( selectedObjectId )
// Traverse the scene for objects scene.traverse( obj = > {
// Check if this has a material and if this is a city object material
if ( obj.material && obj.material.isCityObjectsMaterial ) {
// Set the highlighted object index to what was found before
obj.highlightedObject = {
objectIndex: objectIndex
};
}
} ); ```
Owner
- Name: CityJSON
- Login: cityjson
- Kind: organization
- Website: https://cityjson.org
- Repositories: 14
- Profile: https://github.com/cityjson
For all CityJSON matters. Managed by @tudelft3d
GitHub Events
Total
- Create event: 3
- Commit comment event: 1
- Issues event: 3
- Watch event: 8
- Delete event: 1
- Issue comment event: 2
- Push event: 10
- Pull request event: 6
- Fork event: 6
Last Year
- Create event: 3
- Commit comment event: 1
- Issues event: 3
- Watch event: 8
- Delete event: 1
- Issue comment event: 2
- Push event: 10
- Pull request event: 6
- Fork event: 6
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Stelios Vitalis | s****s@g****m | 164 |
| imtiazShakil | i****1@g****m | 8 |
| Thomas Muguet | t****t@o****m | 3 |
| Ravi Peters | r****s@t****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 10
- Total pull requests: 12
- Average time to close issues: 4 months
- Average time to close pull requests: about 2 months
- Total issue authors: 8
- Total pull request authors: 5
- Average comments per issue: 1.8
- Average comments per pull request: 0.92
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 8
- Average time to close issues: 4 months
- Average time to close pull requests: 2 months
- Issue authors: 2
- Pull request authors: 4
- Average comments per issue: 0.5
- Average comments per pull request: 0.75
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- sguimmara (2)
- robhawkes (2)
- balazsdukai (1)
- hopezh (1)
- liberostelios (1)
- wlinna (1)
- imtiazShakil (1)
Pull Request Authors
- tmuguet (6)
- imtiazShakil (3)
- vincjo (2)
- HideBa (1)
- Ylannl (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 87 last-month
- Total dependent packages: 2
- Total dependent repositories: 3
- Total versions: 5
- Total maintainers: 2
npmjs.org: cityjson-threejs-loader
A CityJSON loader for three.js
- Homepage: https://github.com/cityjson/cityjson-threejs-loader#readme
- License: MIT
-
Latest release: 0.4.0
published over 2 years ago