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

@jwc/csg-viewer

v1.0.0

Published

[![GitHub version](https://badge.fury.io/gh/jscad%2Fcsg-viewer.svg)](https://badge.fury.io/gh/jscad%2Fcsg-viewer) [![Build Status](https://travis-ci.org/jscad/csg-viewer.svg)](https://travis-ci.org/jscad/csg-viewer)

Downloads

6

Readme

csg-viewer

GitHub version Build Status

3D viewer for Csg.js / Openjscad csg/cag data : small, fast, simple

This is a very early version of this viewer ! Expect changes !

Overview

Table of Contents

Installation

npm install jscad/csg-viewer

Usage

// With ES6/2015 +
import makeViewer from 'csg-viewer'
// with commonjs
// import viewer creator function
const makeViewer = require('csg-viewer')

const viewerOptions = {
  background: [0.211, 0.2, 0.207, 1], // [1, 1, 1, 1],//54, 51, 53
  meshColor: [0.4, 0.6, 0.5, 1],
  grid: {
    display: true,
    color: [1, 1, 1, 0.1]
  },
  camera: {
    position: [450, 550, 700]
  },
  controls: {
    limits: {
      maxDistance: 1600,
      minDistance: 0.01
    }
  }
}
// create viewer
const {csgViewer, viewerDefaults, viewerState$} = makeViewer(document.body, viewerOptions)
// and just run it, providing csg/cag data
let csg = CSG.cube()
csgViewer(viewerOptions, {solids: csg})

//you can also just call the viewer function again with either/or new data or new settings
csgViewer({camera: { position: [0, 100, 100] }})

csg = CSG.sphere()
csgViewer({}, {solids: csg})

// and again, with different settings: it only overrides the given settings
csgViewer({controls: {autoRotate: {enabled: true}}})

Test

There are no unit tests for the 3d viewer, however there is a small demo that is very practical to iterate fast and to see something visual without a complicated setup:

type:

npm run dev this will start the demo at localhost:9966

API

Work in progress!

Sponsors

License

The MIT License (MIT) (unless specified otherwise)