Skip to main content

normal-position-combination

Python Binding for Efficiently Combining Positions and Normals for Precise 3D Geometry

PyPI version Build & Test Publish to Pypi

Before After Before After
Before After Before After
Efficiently Combining Positions and Normals for Precise 3D Geometry

Nehab, D.; Rusinkiewicz, S.; Davis, J.; Ramamoorthi, R.
ACM Transactions on Graphics - SIGGRAPH 2005
Los Angeles, California, July 2005, Volume 24, Issue 3, pp. 536-543

Original C++ implementation: normal-position-combination

Install

pip install normal-position-combination

Usage

First you need to have a mesh with (relatively) accurate vertex normals. The method will optimize the vertex positions to better fit the normals.

Process a trimesh.Trimesh Object

import trimesh
import normal_position_combination as npc
mesh = trimesh.load_mesh('./sample_data/panel.ply')
optimized_mesh = npc.process_trimesh(mesh)

Process on numpy Arrays

Input mesh vertices, faces, and normals as numpy arrays, and get the optimized vertices.

import numpy as np
import normal_position_combination as npc
mesh = trimesh.load_mesh('./sample_data/panel.ply')
optimized_vertices = npc.process_ndarray(
    np.array(mesh.vertices, dtype=np.float32),
    np.array(mesh.faces, dtype=np.int64),
    np.array(mesh.vertex_normals, dtype=np.float32),
)

Directly Process a Mesh File

import normal_position_combination as npc
npc.process_mesh_file(
    input_filename='./sample_data/panel.ply',
    output_filename='./sample_data/processed-panel.ply'
)

Parameters

Please refer to the original implementation's manual for the detailed explanation of the parameters.

Build from Source

Ubuntu / Debian

# build trimesh2
sudo apt install libglu1-mesa libglu1-mesa-dev libxi-dev
cd submodules/trimesh2
make -j

# build normal-position-combination
cd ../..
sudo apt install libsuitesparse-dev
pip install .

RHEL Series

sudo yum install mesa-libGLU mesa-libGLU-devel libXi-devel suitesparse-devel openblas-devel libomp-devel
cd submodules/trimesh2
make -j

cd ../..
sudo yum install suitesparse-devel
pip install .

Metadata

Release files for normal-position-combination 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for normal-position-combination 0.0.3
File Size Uploaded
normal-position-combination-0.0.3.tar.gz 8.9 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for normal-position-combination 0.0.3
File
normal_position_combination-0.0.3-cp312-abi3-manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64 Details
normal_position_combination-0.0.3-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
normal_position_combination-0.0.3-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
normal_position_combination-0.0.3-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details
normal_position_combination-0.0.3-cp38-cp38-manylinux_2_28_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.28+ x86-64 Details

Total release size: 40.8 MB

Release files / normal-position-combination-0.0.3.tar.gz

Download URL normal-position-combination-0.0.3.tar.gz
Size 8.9 MB
Tags Source
SHA-256 checksum
How to use checksums
f07031123dfc527f0f477bdd6dfe9c9afd95a9d971ec3d25673322c3ccc9fce0
BLAKE2b-256 checksum
How to use checksums
5048b3fcb225c243571482e7773a5da68786bd88717c2382bf2627b346e5e558
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / normal_position_combination-0.0.3-cp312-abi3-manylinux_2_28_x86_64.whl

Download URL normal_position_combination-0.0.3-cp312-abi3-manylinux_2_28_x86_64.whl
Size 6.4 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
ec38cb845e39fba42b24760ba6e1f460652cd0d44edb1dfacb73b9b2da2498a9
BLAKE2b-256 checksum
How to use checksums
d7841ea4c3d58366014fc5aee2758c6123331d1c7c86a5d292c98ff93d2050a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / normal_position_combination-0.0.3-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL normal_position_combination-0.0.3-cp311-cp311-manylinux_2_28_x86_64.whl
Size 6.4 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0230e35ed2a430c83bef46e83b9c8731c3ea23cdeac733ca6bb2cc61e01e9501
BLAKE2b-256 checksum
How to use checksums
8d72f7ba0b82dd17e5f84810b7021f2778f224c2f2725f401384eff1fec0cfa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / normal_position_combination-0.0.3-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL normal_position_combination-0.0.3-cp310-cp310-manylinux_2_28_x86_64.whl
Size 6.4 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bc1a6d8ee99582563fb614576a7255959c36a5159e4ec8895eb33aaed0df4b0b
BLAKE2b-256 checksum
How to use checksums
4e6d9344b22a5ee4a2ac369691a552ba186056a54ddf3802af4386435056c59e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / normal_position_combination-0.0.3-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL normal_position_combination-0.0.3-cp39-cp39-manylinux_2_28_x86_64.whl
Size 6.4 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6a04ab7fd955e215379fb3ea05ad8e5b1fe0769685e215d3c134dcc75cb321df
BLAKE2b-256 checksum
How to use checksums
5bec8511bf455492ea78a0438e31dc9c0036399be6b46da0a40df4d15816f58b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / normal_position_combination-0.0.3-cp38-cp38-manylinux_2_28_x86_64.whl

Download URL normal_position_combination-0.0.3-cp38-cp38-manylinux_2_28_x86_64.whl
Size 6.4 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b855bec9b43d146ab3292891b50a4dabb09ccd6527dd0defda5b26dbdc553c06
BLAKE2b-256 checksum
How to use checksums
9144a7c9119004167f70c95593a9c0b8ff60cf5e75d2102aebe70be055829a16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

6 release files

0.0.2

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page