1.0.0 • Published 2 years ago

three-geojson v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Installation

npm install three-geojson

Prepare Data

npx three-geojson-convert input.geojson 4000 > out.tri.json

Example

import { geoPlaneGeometry, geoContourGeomtry } from 'three-geojson';


const geo = Object.entries(triJson).reduce((geoLayer, [name, tri]) => {
	const plane = new THREE.Mesh(
		geoPlaneGeometry(tri, radius, thickness, dimension),
		new THREE.MeshStandardMaterial({
			color: 0x808080,
			transparent: true,
			opacity: 0.9,
			side: THREE.DoubleSide,
		})
	);
	plane.userData.type = 'plane';

	const contour = new THREE.LineSegments(
		geoContourGeomtry(tri, radius, thickness, dimension),
		new THREE.LineBasicMaterial({
			color: 0xff8080,
			depthTest: true,
			opacity: 1,
			transparent: true,
			linewidth: 0.3,
		})
	);
	contour.userData.type = 'border';

	const obj = new THREE.Object3D();
	obj.name = name;
	obj.add(plane);
	obj.add(contour);

	geoLayer.add(obj);

	return geoLayer;
}, new THREE.Object3D());

scene.add(geo);
1.0.0

2 years ago

0.1.4

2 years ago

0.1.5

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago