Skip to content
Back to skills

Terrain Integration

ASecurity

Terrain interaction systems for Three.js building games. Use when implementing slope handling, foundation anchoring (Valheim pattern), terrain modification, auto-leveling, or pillar/support generation. Integrates with structural-physics for ground-based stability.

  • 207 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added February 7, 2026
developmentjavascriptrustgojavanode

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add NeverSight/skills_feed --skill terrain-integration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Terrain Integration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Terrain Integration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-terrain-integration/badge)](https://www.skillsdirectory.com/skills/neversight-terrain-integration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: terrain-integration
description: Terrain interaction systems for Three.js building games. Use when implementing slope handling, foundation anchoring (Valheim pattern), terrain modification, auto-leveling, or pillar/support generation. Integrates with structural-physics for ground-based stability.
---

# Terrain Integration

Foundation placement, slope handling, and terrain modification for building systems.

## Quick Start

```javascript
import { TerrainAnalyzer } from './scripts/terrain-analyzer.js';
import { FoundationPlacer } from './scripts/foundation-placer.js';

// Analyze terrain at build location
const analyzer = new TerrainAnalyzer(terrainMesh);
const slopeData = analyzer.analyzeSlope(position, { radius: 4 });
// slopeData: { angle: 15, normal: Vector3, canBuild: true }

// Place foundation with auto-leveling
const placer = new FoundationPlacer({ 
  mode: 'valheim', // or 'rust', 'ark'
  maxSlope: 30,
  autoLevel: true 
});
const result = placer.place(foundationPiece, position, analyzer);
// result: { valid: true, height: 2.3, pillarsNeeded: 2 }
```

## Reference

See `references/terrain-integration-advanced.md` for:
- Slope analysis algorithms and thresholds
- Foundation anchoring patterns (Valheim ground contact rule)
- Auto-leveling strategies
- Terrain modification networking
- Pillar generation for uneven terrain

## Scripts

- `scripts/terrain-analyzer.js` - Slope detection, buildability checks, terrain sampling
- `scripts/foundation-placer.js` - Foundation placement with Valheim/Rust/ARK modes
- `scripts/terrain-modifier.js` - Flatten, raise, lower terrain operations
- `scripts/pillar-generator.js` - Auto-generate support pillars for slopes

## Foundation Modes

- **Valheim**: Ground contact = 100% stability, foundations must touch terrain
- **Rust**: Foundations snap to grid, terrain ignored after placement
- **ARK**: Flexible placement with auto-pillars, moderate slope tolerance

## Integration

Works with `structural-physics` for stability calculations. Grounded foundations feed into the support graph as root nodes with maximum stability.

```javascript
// Integration example
const grounded = placer.place(foundation, pos, analyzer);
if (grounded.valid) {
  foundation.isGrounded = true;
  foundation.stability = 1.0; // Feed to structural-physics
  validator.addPiece(foundation);
}
```

Files in this skill

  • SKILL.md2.3 KB
  • description_cn.txt224 B
  • description_de.txt301 B
  • description_en.txt265 B
  • description_es.txt314 B
  • description_fr.txt356 B
  • description_ja.txt335 B
  • description_ko.txt268 B
  • description_tw.txt224 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.