You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V-Sekai is a collaborative community where we work on social VR. One of the things we've been working on is better Godot-native mesh creation.
Describe the problem or limitation you are having in your project
Godot CSG tends to make long, thin triangles. I want to write a gdextension or godot-sandbox that can extend CSGShape3D so that I can process geometry with Integer Coordinates for Intrinsic Geometry Processing, which requires manifold geometry.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I am having trouble workarounding missing exposed internal methods via conversion to ArrayMesh.
It's like having a property that's a CSGMesh3D and extracting the ArrayMesh so we can process it and put it back into the CSGMesh3D as an array mesh for the next node in the csg tree.
extendsMeshInstance3Dfunc_ready():
awaitget_tree().process_framevarparent_node=get_parent()
ifnotparent_nodeornotparent_node.has_method("is_root_shape") ornotparent_node.is_root_shape():
print("Error: Parent is not a CSGMesh root node.")
returnvarmeshes=parent_node.get_meshes()
ifmeshes.size() >1:
varcombined_mesh=meshes[1]
ifcombined_mesh:
replace_with_processed_mesh(parent_node, combined_mesh)
else:
print("Error: Not enough meshes in the root node.")
funcprocess_array_mesh(array_mesh: ArrayMesh):
print("Processing ArrayMesh with surface count: ", array_mesh.get_surface_count())
varvertex_count=0foriinrange(array_mesh.get_surface_count()):
varsurface_array=array_mesh.surface_get_arrays(i)
varvertices=surface_array[Mesh.ARRAY_VERTEX]
vertex_count+=vertices.size()
print("Total number of vertices: ", vertex_count)
funcreplace_with_processed_mesh(root_node, processed_mesh):
process_array_mesh(processed_mesh)
varmesh_instance=MeshInstance3D.new()
mesh_instance.mesh=processed_meshmesh_instance.global_transform=root_node.global_transformifnotroot_node.get_parent():
returnroot_node.get_parent().add_child(mesh_instance)
root_node.queue_free()
Is there a reason why this should be core and not an add-on in the asset library?
It's prohibitive to make a CSGShape3D gdextension for add-ons.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
V-Sekai is a collaborative community where we work on social VR. One of the things we've been working on is better Godot-native mesh creation.
Describe the problem or limitation you are having in your project
Godot CSG tends to make long, thin triangles. I want to write a gdextension or godot-sandbox that can extend CSGShape3D so that I can process geometry with Integer Coordinates for Intrinsic Geometry Processing, which requires manifold geometry.
Here's a standalone application version of "Integer Coordinates for Intrinsic Geometry Processing" https://github.com/V-Sekai/TOOL_mesh_intrinsic-triangulations
From the community, https://github.com/SpockBauru/CSG_Terrain/blob/main/addons/csg_terrain/csg_terrain.gd extends CSGMesh3D, which means there's an extra conversion from the internal faces API to ArrayMesh.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I want to expose CSGShape3D gdextension APIs and still looking for a good approach.
Describe how your proposal will work with code, pseudo-code, mock-ups, and/or diagrams
Expose in CSGBrush3D a process shape function similar to
AnimationNodeExtension
Convert from the internal CSGBrush3D to
virtual Error build_shape(PackedFloat64Array &faces, TypedVector<Material> &materials)
Run the extended operation.
Return the shape as PackedFloat64Array and TypedVector.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I am having trouble workarounding missing exposed internal methods via conversion to ArrayMesh.
It's like having a property that's a CSGMesh3D and extracting the ArrayMesh so we can process it and put it back into the CSGMesh3D as an array mesh for the next node in the csg tree.
Is there a reason why this should be core and not an add-on in the asset library?
It's prohibitive to make a CSGShape3D gdextension for add-ons.
The text was updated successfully, but these errors were encountered: