npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

potree-and-type

v1.8.5

Published

WebGL point cloud viewer

Downloads

18

Readme

About

Getting Started

Install on your PC

Install node.js

Install dependencies, as specified in package.json, and create a build in ./build/potree.

npm install

Run on your PC

Use the npm start command to

  • create ./build/potree
  • watch for changes to the source code and automatically create a new build on change
  • start a web server at localhost:1234.

Go to http://localhost:1234/examples/ to test the examples.

Deploy to a server

  • Simply upload the Potree folderm with all your point clouds, the build directory, and your html files to a web server.
  • It is not required to install node.js on your webserver. All you need is to host your files online.

Convert Point Clouds to Potree Format

Download PotreeConverter and run it like this:

./PotreeConverter.exe C:/pointclouds/data.las -o C:/pointclouds/data_converted

Copy the converted directory into <potreeDirectory>/pointclouds/data_converted. Then, duplicate and rename one of the examples and modify the path in the html file to your own point cloud.

Downloads

Examples

VR

Showcase

Funding

Potree is funded by a combination of research projects, companies and institutions.

Research projects who's funding contributes to Potree:

We would like to thank our sponsors for their financial contributions that keep this project up and running!

Credits

  • The multi-res-octree algorithms used by this viewer were developed at the Vienna University of Technology by Michael Wimmer and Claus Scheiblauer as part of the Scanopy Project.
  • Three.js, the WebGL 3D rendering library on which potree is built.
  • plas.io point cloud viewer. LAS and LAZ support have been taken from the laslaz.js implementation of plas.io. Thanks to Uday Verma and Howard Butler for this!
  • Harvest4D Potree currently runs as Master Thesis under the Harvest4D Project
  • Christian Boucheny (EDL developer) and Daniel Girardeau-Montaut (CloudCompare). The EDL shader was adapted from the CloudCompare source code!
  • Martin Isenburg, Georepublic, Veesus, Sigeom Sa, SITN, LBI ArchPro, Pix4D as well as all the contributers to potree and PotreeConverter and many more for their support.

如何在npm里面使用

  1. 安装依赖

    npm i potree-and-type
  2. 在node_modules里面找到potree-and-type,把dist里面的libs和resources、workers文件夹复制到项目的public目录(vue项目中)

  3. 在main.ts中加入如下代码(vue项目中)

    import * as Potree from "potree-and-type"
    
    window.Potree = Potree;
    window.Potree.scriptPath = `${window.Potree.scriptPath}${import.meta.env.BASE_URL}`;
    window.Potree.resourcePath = `${window.Potree.scriptPath}/resources`;
  4. 在index.html中加入如下代码:

    <!doctype html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8" />
    	<link rel="icon" type="image/svg+xml" href="/vite.svg" />
    	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    	<!-- 添加需要的依赖项 -->
    	<script src="./public/libs/jquery/jquery-3.1.1.min.js"></script>
    	<script src="./public/libs/spectrum/spectrum.js"></script>
    	<script src="./public/libs/jquery-ui/jquery-ui.min.js"></script>
    	<script src="./public/libs/other/BinaryHeap.js"></script>
    	<script src="./public/libs/tween/tween.min.js"></script>
    	<script src="./public/libs/d3/d3.js"></script>
    	<script src="./public/libs/proj4/proj4.js"></script>
    	<script src="./public/libs/openlayers3/ol.js"></script>
    	<script src="./public/libs/i18next/i18next.js"></script>
    	<script src="./public/libs/jstree/jstree.js"></script>
    	<script src="./public/libs/plasio/js/laslaz.js"></script>
    	<!--  -->
    	<title>Vite + Vue + TS</title>
    </head>
    <body>
    	<div id="app"></div>
    	<script type="module" src="/src/main.ts"></script>
    </body>
    </html>
    
  5. 写一个hello world场景(vue项目中)

    // App.vue
    <template>
    	<div class="three-container" ref="threeContainer"></div>
    </template>
    <script lang="ts" setup>
    import { onMounted, ref } from "vue";
    import { PotreeHelper } from "./potreeHelper/index"
    
    const threeContainer = ref();
    onMounted(() => {
    	const potreeHelper = new PotreeHelper(threeContainer.value);
    })
    </script>
    
    <style lang="scss" scoped>
    .three-container {
    	width: 100%;
    	height: 100%;
    }
    </style>
    // potreeHelper.ts
    import * as Potree from "potree-and-type"
    
    export class PotreeHelper {
    	constructor(threeContainer: HTMLDivElement) {
    		const viewer = new Potree.Viewer(threeContainer);
    		viewer.setEDLEnabled(true);
    		viewer.setFOV(60);
    		viewer.setPointBudget(1_000_000);
    		Potree.loadPointCloud("datas/pointclouds/room/metadata.json", "room", (e: any) => {
    			viewer.scene.addPointCloud(e.pointcloud);
    			let material = e.pointcloud.material;
    			material.size = 1;
    			material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
    			viewer.fitToScreen();
    		})
    	}
    }