https://github.com/cityjson/cityjson-threejs-loader

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

cityjson threejs
Last synced: 5 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: cityjson
  • License: apache-2.0
  • Language: JavaScript
  • Default Branch: main
  • Homepage:
  • Size: 26.6 MB
Statistics
  • Stars: 26
  • Watchers: 4
  • Forks: 17
  • Open Issues: 5
  • Releases: 0
Topics
cityjson threejs
Created about 5 years ago · Last pushed 7 months ago
Metadata Files
Readme License

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

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

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

All Time
  • Total Commits: 176
  • Total Committers: 4
  • Avg Commits per committer: 44.0
  • Development Distribution Score (DDS): 0.068
Past Year
  • Commits: 2
  • Committers: 2
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email 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
help wanted (1)
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

  • Versions: 5
  • Dependent Packages: 2
  • Dependent Repositories: 3
  • Downloads: 87 Last month
Rankings
Dependent repos count: 6.4%
Forks count: 6.7%
Average: 7.9%
Stargazers count: 8.3%
Dependent packages count: 8.8%
Downloads: 9.4%
Maintainers (2)
Last synced: 6 months ago