一个无CGAL依赖、MIT许可的Alpha Wrapping算法实现,能将缺陷三角形汤转化为水密、流形、向外定向的网格,并可控细节层次和紧密度。

Stars

4

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

MIT

最近更新

2026-07-29

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它提供了一个完全独立且无版权限制的CGAL Alpha Wrap替代方案,在几乎所有测试输入上匹配CGAL的几何保证和拓扑,在无GMP环境下速度约快2倍,并带有简洁的Python绑定和全面的测试套件。

适合谁使用

  • 几何处理领域的研究人员和实践者
  • 从事3D模型修复和网格生成的工程师
  • 需要水密外壳的3D打印爱好者
  • 需要宽松许可下鲁棒表面包裹库的开发者

典型使用场景

  • 修复非流形、自相交或开放的三角形汤以供后续处理
  • 为噪声或有缺陷的输入模型生成严格包围的水密、流形表面
  • 调整包裹粗度(alpha)以保留或填补孔洞、手柄等特征
  • 与CGAL官方实现对比以验证或调优结果

项目优势

  • 完全自包含,无版权限制依赖(仅使用Shewchuk的公共域谓词)
  • 提供与CGAL相同的水密、2-流形、向外定向保证,并在多种输入上验证
  • 性能具有竞争力(无GMP环境下通常比CGAL快约2倍),面片数量相近
  • 全面测试,涵盖精确谓词、Delaunay不变量、AABB oracle以及端到端包裹不变性

使用前须知

  • 构建时需要网络获取谓词源码;需C++17和CMake ≥3.16
  • 可选的CGAL参考后端受GPL许可影响,不属于核心MIT许可部分
  • 几何构造(外心、Steiner点)不精确,但算法设计上容忍此问题

README 快速开始

alpha-wrap

A clean-room, CGAL-free and copyleft-free implementation of "Alpha Wrapping with an Offset" (Portaneri, Alliez, Hemmer, Birklein, Kobbelt — ACM TOG 2022).

Given an arbitrary input triangle soup (which may be non-manifold, self-intersecting, open, or defective) and two parameters — alpha (the carving-ball radius / level of detail) and offset (the distance-field iso-level / tightness) — it produces a surface mesh that is:

  • watertight (closed),
  • combinatorially 2-manifold,
  • outward-oriented,
  • strictly enclosing the input, with vertices ~offset outside it,
  • bounded within an O(alpha+offset) band of the offset surface, every facet having circumradius ` soup = /* your input */; aw::WrapStats stats; aw::Mesh m = aw::alpha_wrap(soup, /alpha=/0.05, /offset=/0.002, /manifold=/true, &stats); // m.V : vertices, m.F : outward-oriented triangles

## Python bindings

Install from source (builds the C++ extension via scikit-build-core + nanobind;
needs a C++17 compiler, CMake ≥ 3.16, and network access on first build to fetch
the predicates):

```bash
pip install .
# or straight from GitHub:
pip install "git+https://github.com/alecjacobson/alpha-wrap.git"

Usage — wrap takes a triangle soup (vertices, faces) and returns the wrapped (V, F) as NumPy arrays (float64 and int32):

import numpy as np
import alpha_wrap

V = np.asarray(vertices, float)     # (N, 3)
F = np.asarray(faces, np.int64)     # (M, 3), may be non-manifold / defective

# relative parameters (fractions of the bounding-box diagonal)
W, G = alpha_wrap.wrap(V, F, alpha_rel=1/30, offset_rel=1/900)

# or absolute, and grab the internal stats
W, G, stats = alpha_wrap.wrap(V, F, alpha=0.05, offset=0.002,
                              manifold=True, return_stats=True)

Defaults follow the paper: alpha = diag/20, offset = alpha/30. The output is watertight, outward-oriented, 2-manifold, and strictly encloses the input.

Optional CGAL reference backend

The package can additionally expose alpha_wrap.wrap_cgal(...), which runs CGAL::alpha_wrap_3 for comparison/validation. It is off by default (it fetches Boost + CGAL at build time).

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

hypervising
精选
hypervising GitHub avatar

gta-enhanced-audio-queue-poc

A proof-of-concept tool that patches a synchronous three-slot audio queue in GTA V Enhanced, boosting frame rates from ~260 to ~499 FPS by removing coarse wait delays.

设计与创意
3
ammaarreshi
ammaarreshi GitHub avatar

Generals-Mac-iOS-iPad

This repository ports Command & Conquer Generals: Zero Hour to run natively on Apple Silicon Macs, iPhones, and iPads without emulation, adding touch controls and modern rendering.

C++
1,523
MSNightmare
MSNightmare GitHub avatar

LegacyHive

This repository contains a proof-of-concept for a Windows User Profile Service elevation-of-privilege vulnerability that loads an arbitrary hive into the current user's classes root.

C++
275