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 🙏

© 2026 – Pkg Stats / Ryan Hefner

snowcrystal

v0.1.1

Published

Visualize snow crystal morphology (Nakaya diagram + Global Classification of 121 types) as Three.js geometry. A morphological visualization, not a physical growth model.

Readme

snowcrystal

Three.js geometry for snow-crystal morphology, ported from the snownotes.org 3D snow-crystal viewer.

createSnowCrystal(params) returns a THREE.Group you can drop into any scene. Nine morphologies are supported, selectable directly or derived from a temperature / supersaturation pair (Nakaya diagram).


⚠️ これは形態の可視化です(物理モデルではありません)

本パッケージは、雪結晶の成長を支配する物理法則や微視的な成長メカニズムを数理的に 再現するものではありません。中谷ダイアグラム(気温・過飽和度と形態の対応)と、雪結晶の グローバル分類(121種)という既存の観測図・文献を参照し、結晶の六角対称性・階層構造・ 形態的特徴といった外形を三次元的に可視化する試みです。側面から見た内部構造や厚みは 物理的に正確なモデルではありません。

⚠️ This is a morphological visualization, not a physical model

This package does not numerically reproduce the physical laws or microscopic growth mechanisms governing snow-crystal formation. It is a 3D visualization of crystal morphology based on existing observational diagrams and literature — the Nakaya diagram and the Global Classification of snow crystals (121 types). It focuses on external features such as hexagonal symmetry, hierarchical structure, and characteristic crystal forms, and is not a physically accurate representation of internal structure or thickness.


Install

npm install snowcrystal three

three is a peer dependency — you provide it yourself (>=0.150.0). The package ships ESM only and is tree-shakeable ("sideEffects": false).

Usage

import * as THREE from 'three';
import { createSnowCrystal, disposeCrystal } from 'snowcrystal';

const scene = new THREE.Scene();

// 1) Pick a morphology directly (9 types):
const crystal = createSnowCrystal({ morphology: '樹枝状' });
scene.add(crystal);

// 2) Or derive it from temperature (°C, negative below freezing)
//    and supersaturation (vapor, 0–0.3), like the Nakaya diagram:
const fromClimate = createSnowCrystal({ temperature: -15, supersaturation: 0.25 });
scene.add(fromClimate);

// 3) Deterministic: the same params always produce the same shape.
//    `seed` controls the (otherwise fixed) pseudo-randomness used by some forms.
const seeded = createSnowCrystal({ morphology: '針', seed: 42 });

// Clean up GPU resources when you remove a crystal:
scene.remove(crystal);
disposeCrystal(crystal);

API

type Morphology =
  | '角板' | '角柱' | '針' | 'さや' | '骸晶角柱'
  | '厚角板' | '骸晶角板' | '扇形' | '樹枝状';

interface CrystalParams {
  morphology?: Morphology;   // primary key (9 types)
  temperature?: number;      // °C; with supersaturation, mapped via getCrystalType
  supersaturation?: number;  // vapor, 0–0.3
  seed?: number;             // fixes pseudo-randomness (deterministic by default)
}

function createSnowCrystal(params?: CrystalParams): THREE.Group;
function disposeCrystal(group: THREE.Group): void;
function getCrystalType(temp: number, vapor: number): Morphology;
function getGlobalLabel(morphology: Morphology): string; // e.g. '樹枝状' -> 'P4g'

If morphology is omitted but temperature and supersaturation are given, the morphology is derived via getCrystalType. If nothing is given, it defaults to '樹枝状'.

Playground

npm run dev

A minimal Three.js viewer with a morphology selector and OrbitControls.


Sources / 出典

  • Nakaya, U. (1955): Snow Crystals and Aerosols. Journal of the Faculty of Science, Hokkaido University, Japan, Ser. II, 4(6), 341–354.
  • Kobayashi, T. (1960): Experimental researches on the snow crystal habit and growth using a convection-mixing chamber. J. Meteorol. Soc. Japan, 38, 231–238.
  • 菊地勝弘・亀田貴雄・樋口敬二・山下 晃・雪結晶の新しい分類表を作る会メンバー (2012): 中緯度と極域での観測に基づいた新しい雪結晶の分類 ─グローバル分類─. 雪氷, 74(3), 223–241.
  • Kikuchi, K., Kameda, T., Higuchi, K. & Yamashita, A. (2013): A global classification of snow crystals, ice crystals, and solid precipitation based on observations from middle latitudes to polar regions. Atmospheric Research, 132, 460–472. doi:10.1016/j.atmosres.2013.06.006

Related / 関連

This package ports the geometry from the SnowNotes "3D Visualization of Snow Crystals" web tool, which is introduced in:

  • 上村祥太郎 (2026)「インタラクティブな可視化ツールを用いた『雪結晶 3D ビジュアル』の紹介」(談話室)雪氷, 88(3), 215–217. ISSN 0373-1006. https://snownotes.org/elsewhere/snow-crystal-3d-seppyo/
  • Kamimura, S. (2026): Introduction to "3D Visualization of Snow Crystals," an interactive visualization tool (Note). Seppyo, 88(3), 215–217. ISSN 0373-1006. https://snownotes.org/en/elsewhere/snow-crystal-3d-seppyo/

License

MIT © 2026 Shotaro Kamimura (SnowNotes)