New:Socket for Asana Is Now Available.Learn more
Get Started

@triforge/radius-parametric-geometry

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@triforge/radius-parametric-geometry

Parametric geometry for Three.js - 90.6% triangle reduction

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
10
Maintainers
1
Weekly downloads
 
Created
Source

@three-radius-parametric

Optimized parametric geometry for Three.js with 90.6% triangle reduction.

Installation

npm install @three-radius-parametric three

Quick Start

import { RadiusParametricGeometry } from '@three-radius-parametric'
import * as THREE from 'three'

const geometry = new RadiusParametricGeometry(
  (u, v) => 1 + 0.5 * Math.cos(v * Math.PI * 2),
  (u, v) => 0.5 * Math.sin(v * Math.PI * 2),
  { radiusSegments: 32, heightSegments: 16 }
)

const mesh = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial({ color: 0x00ff00 }))
scene.add(mesh)

API

Constructor

new RadiusParametricGeometry(
  radiusFunction: (u: number, v: number) => number,
  heightFunction?: (u: number, v: number) => number,
  options?: RadiusGeometryOptions
)

Both u and v are in [0, 1].

Options

OptionDefaultDescription
radiusSegments32Segments around the axis
heightSegments16Segments along the height
thetaStart0Start angle (radians)
thetaLengthAngle sweep (radians)

Methods

  • getStats(): GeometryStats — vertex count, triangle count, memory usage

Examples

Sphere

new RadiusParametricGeometry((u, v) => Math.sin(v * Math.PI))

Cone

new RadiusParametricGeometry(
  (u, v) => 1 - v,
  (u, v) => v
)

Torus

new RadiusParametricGeometry(
  (u, v) => 1 + 0.5 * Math.cos(v * Math.PI * 2),
  (u, v) => 0.5 * Math.sin(v * Math.PI * 2)
)

Wavy Cylinder

new RadiusParametricGeometry(
  (u, v) => 1 + 0.3 * Math.sin(u * Math.PI * 4 + v * Math.PI * 2)
)

Performance

  • 90.6% triangle reduction vs high-resolution standard approach
  • 88%+ memory reduction
  • Compatible with all Three.js materials and physics engines

License

MIT

Keywords

three.js

FAQs

Package last updated on 20 Jun 2026

Related posts