All Projects → Danny02 → JOpenCTM

Danny02 / JOpenCTM

Licence: LGPL-3.0 license
Java implementation of the openCTM Mesh compression file format

Programming Languages

java
68154 projects - #9 most used programming language
IDL
102 projects
shell
77523 projects

Projects that are alternatives of or similar to JOpenCTM

Compressonator
Tool suite for Texture and 3D Model Compression, Optimization and Analysis using CPUs, GPUs and APUs
Stars: ✭ 785 (+5938.46%)
Mutual labels:  compression, 3d-models
torchprune
A research library for pytorch-based neural network pruning, compression, and more.
Stars: ✭ 133 (+923.08%)
Mutual labels:  compression
dedupsqlfs
Deduplicating filesystem via Python3, FUSE and SQLite
Stars: ✭ 24 (+84.62%)
Mutual labels:  compression
timelite
String date and time utilities 🕙
Stars: ✭ 17 (+30.77%)
Mutual labels:  format
kanzi-cpp
Lossless data compression in C++
Stars: ✭ 60 (+361.54%)
Mutual labels:  compression
DRV3-Tools
(Not actively maintained, use DRV3-Sharp) Tools for extracting and re-injecting files for Danganronpa V3 for PC.
Stars: ✭ 13 (+0%)
Mutual labels:  compression
Unishox2
Compression for Unicode short strings
Stars: ✭ 124 (+853.85%)
Mutual labels:  compression
mtscomp
Multichannel time series lossless compression in pure Python based on NumPy and zlib
Stars: ✭ 20 (+53.85%)
Mutual labels:  compression
arch-config
Scripts and Ansible playbook to setup Arch Linux on ZFS.
Stars: ✭ 36 (+176.92%)
Mutual labels:  compression
ObjToSchematic
A tool to convert .obj files into Minecraft Schematics
Stars: ✭ 156 (+1100%)
Mutual labels:  3d-models
raroscope
A pure Java library for scanning and enumerating RAR archive contents
Stars: ✭ 32 (+146.15%)
Mutual labels:  compression
pcad2kicad
Convert Altium Designer and PCAD library to KiCad
Stars: ✭ 94 (+623.08%)
Mutual labels:  3d-models
prunnable-layers-pytorch
Prunable nn layers for pytorch.
Stars: ✭ 47 (+261.54%)
Mutual labels:  compression
Frost
A backup program that does deduplication, compression, encryption
Stars: ✭ 25 (+92.31%)
Mutual labels:  compression
Oroch
A C++ library for integer array compression
Stars: ✭ 22 (+69.23%)
Mutual labels:  compression
blz4
Example of LZ4 compression with optimal parsing using BriefLZ algorithms
Stars: ✭ 24 (+84.62%)
Mutual labels:  compression
zig-snappy
Snappy compression for Zig
Stars: ✭ 25 (+92.31%)
Mutual labels:  compression
winston-dev-console
Winston@3 console format aimed to improve development UX
Stars: ✭ 88 (+576.92%)
Mutual labels:  format
format-number
文本框数字格式化
Stars: ✭ 17 (+30.77%)
Mutual labels:  format
unishox js
JS Library for Guaranteed compression of Unicode short strings
Stars: ✭ 27 (+107.69%)
Mutual labels:  compression

JOpenCTM Build Status

Java implementation of the OpenCTM file-format. This library is licensed under the LGPL 3.0 License.

Content

Getting Started

    <dependency>
        <groupId>com.github.danny02</groupId>
        <artifactId>JOpenCTM</artifactId>
        <version>1.5.2</version>
    </dependency>

Compression Formats

Raw

Raw binary dump of the vertex data. The format does not apply any compression, but piping the output stream through e.g. gzip gives quite an improvement

MG1

"Lossless" mesh compression. Not completly lossless, because the vertex and index odering is lost/changed.

MG2

Lossy mesh encoding. Precision values are provided for the attributes which represent a maximum agreeable error in the data.

The Mesh Pojo

A mesh in the OpenCTM format supports the following data per vertex:

  • one 4D position vector
  • one 3D optional normal vector
  • N 2D texture coordinates
  • N 4D custom vertex attribute vectors

The mesh also contains an triangle index list (three consecutive indicies form a triangle of the mesh).

    float[] vertices = {...};
    float[] normals = {...} // or 'null' of not existing;
    int[] indices = {...};
    
    //provide an empty array if the mesh has no texture coordinates, same goes for the custom attributes
    AttributeData[] texcoordinates = new AttributeData[0];
    //each custom attribute defines an own precision value for the MG2 encoder
    AttributeData[] attributes = {new AttributeData("attribute name", "material name", STANDARD_PRECISION, new float[]{...})};
    
    Mesh mesh = new Mesh(vertices, normals, indices, texcoordinates, attributes);
    
    //you should always check the integrity of the model before encoding
    //report errors with checked exception
    mesh.checkIntegrity();
    //return a list of errors
    mesh.validate();

Take a look at all the properties which are checked.

Usage

Reading a OpenCTM file

    InputStream in = new FileInputStream(...);
    CtmFileReader reader = new CtmFileReader(in);
    
    //read a CTM file into memory without checking any mesh properties
    Mesh mesh = reader.decodeWithoutValidation();
    //read a CTM file while checking some propeties, i.e. indicies point to valid verticies, count of normals is equal to vertex count
    Mesh validMesh = reader.decode();

Writing a OpenCTM file

    OutputStream out = new FileOutputStream(...);
    MeshEncoder rawEncoder = new RawEncoder();
    MeshEncoder mg1Encoder = new MG1Encoder();
    //MG2 is an lossy encoding. The precision values define the maximum error of the vertex attributes
    MeshEncoder mg2Encoder = new MG2Encoder(VERTEX_PRECISION, NORMAL_PRECISION);
    
    CtmFileWriter writer = new CtmFileWriter(out, rawEncoder);
    //the compression factor is only used by the two MG encoders and ignored by the raw encoder
    CtmFileWriter compressedWriter = new CtmFileWriter(out, mg2Encoder, lzmaCompressionFactor /*1-9, 5 gives already nearly the best compression*/);
    
    Mesh teapot = ...;
    writer.encode(teapot, "Written by my awesome App!");

Tools and Integrations

  • OpenCTM C++ reference implementation provides tools like a model viewer and a commandline converter from and to OpenCTM from common 3D model formats
  • OpenCTM Validator a simple commandline tool to validate and inspect a OpenCTM file

Similiar Projects

  • Open3DGC better results than OpenCTM and properly supported by Khronos Group
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].