Skip to content

Split obj file to individual objects  #686

Closed

Description

@drSpritz-spider-group

Hello!
I'm new to working with assimp, so my question may seems very simple. Assimp I use to import models in the Unity engine, which has a limit on the maximum number of verticies per mesh, it is 65000. How can I use assimp for split the file into stand-alone objects, the number of vertices of which will not exceed the set (65 000)?

Obj file should look like this

input obj source:

# File produced by Open Asset Import Library (http://www.assimp.sf.net)
# (assimp v3.1.28522525)

mtllib modelResult.obj.mtl

#126978 vertex positions
v -1.51537 5.03191 -0.149251
v ......
#126928 vertex normals
vn -0.3027 0.9527 -0.0275
vn ......
# Mesh 'Sphere_None' with 126976 faces
g Sphere_None
usemtl None
f 1//1 2//1 3//1 4//1
f ......

out obj source:

# File produced by Open Asset Import Library (http://www.assimp.sf.net)
# (assimp v3.1.28522525)

mtllib modelResult.obj.mtl

o Sphere_none_mesh01
#65000 vertex positions
v -1.51537 5.03191 -0.149251
v ......
#65000 vertex normals
vn -0.3027 0.9527 -0.0275
vn ......
# Mesh 'Sphere_None_mesh01' with 65000 faces
g Sphere_None
usemtl None
f 1//1 2//1 3//1 4//1
f ......

o Sphere_none_mesh02
#65000 vertex positions
v -1.51537 5.03191 -0.149251
v ......
#65000 vertex normals
vn -0.3027 0.9527 -0.0275
vn ......
# Mesh 'Sphere_None_mesh02' with 65000 faces
g Sphere_None_mesh
usemtl None
f 1//1 2//1 3//1 4//1
f ......

o Sphere_none_mesh03
#1235 vertex positions
v -1.51537 5.03191 -0.149251
v ......
#1235 vertex normals
vn -0.3027 0.9527 -0.0275
vn ......
# Mesh 'Sphere_None_mesh03' with 1235 faces
g Sphere_None
usemtl None
f 1//1 2//1 3//1 4//1
f ......

Perhaps, in dst obj source I made some mistakes, but I think common sense should be clear.
Thanks for answers and sorry for my english.

Activity

  1. kimkulling commented on Nov 11, 2015

    @kimkulling
    Member

    During the preprocessing you can use the SplitLargeMeshesProcess_Triangle-process. Please check the documentation of code/SplitLargeMeshesProcess_Triangle .h .

  2. added a commit that references this issue on Dec 11, 2023
  3. added a commit that references this issue on Feb 5, 2024
  4. added
    Question
    on Apr 17, 2025
  5. added a commit that references this issue on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions