<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/13358" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2022-01-23T11:39:24+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/13358</id>

		<entry>
		<author><name><![CDATA[bluefish_]]></name></author>
		<updated>2022-01-23T11:39:24+00:00</updated>

		<published>2022-01-23T11:39:24+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43817#p43817</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43817#p43817"/>
		<title type="html"><![CDATA[How to  manually create convex collision mesh for concave meshes instead of vhacd?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43817#p43817"><![CDATA[
Hello! I'm using pybullet to simulate a scene with a few objects chaining together under gravity and the hook object is passing through the box opening:<div class="inline-attachment"><dl class="file"><dt class="attach-image"><img src="https://pybullet.org/Bullet/phpBB3/download/file.php?id=1903" class="postimage" alt="Screen Shot 2022-01-23 at 3.29.22 AM.png" onclick="viewableArea(this);" /></dt></dl></div><div class="inline-attachment"><dl class="file"><dt class="attach-image"><img src="https://pybullet.org/Bullet/phpBB3/download/file.php?id=1905" class="postimage" alt="Screen Shot 2022-01-23 at 3.30.27 AM.png" onclick="viewableArea(this);" /></dt></dl></div><div class="inline-attachment"><dl class="file"><dt class="attach-image"><img src="https://pybullet.org/Bullet/phpBB3/download/file.php?id=1904" class="postimage" alt="Screen Shot 2022-01-23 at 3.29.25 AM.png" onclick="viewableArea(this);" /></dt></dl></div>I'm using vhacd to generate a convex decomposition of the original box mesh because the original shape is concave (using code <div class="codebox"><p>Code: </p><pre><code>p.vhacd(self.part_obj_path, obj_acd_path, "log.txt", pca=True, mode=1)</code></pre></div>). Somehow vhacd is not working super well for this concave mesh and I tried to create a mesh file with "o convex_#" of different components but it still didn't seem to help. I'm wondering in this case is it because the collision mesh is not correct or because of some other factors?<br><br>Below is the rough structure of my code; please let me know if there's anything in my code that might be contributing to this; thanks very much!<div class="codebox"><p>Code: </p><pre><code>        p.connect(p.GUI)    p.setAdditionalSearchPath(pybullet_data.getDataPath())    # disable rendering    p.configureDebugVisualizer(p.COV_ENABLE_RENDERING, 0)    p.configureDebugVisualizer(p.COV_ENABLE_GUI, 0)    p.configureDebugVisualizer(p.COV_ENABLE_TINY_RENDERER, 0)    p.setGravity(0,0,-9.8)    for id, part in list_of_parts():        part_mesh = get_part_mesh()        mesh_color = part_mesh.get_color()        rgba = list(mesh_color) + [1]        quarternion = p.getQuaternionFromEuler(part.frame.radians_rot())        visualShapeId = p.createVisualShape(shapeType=p.GEOM_MESH,                            fileName=part.collision_obj_path,                            rgbaColor=rgba,                            visualFramePosition=part.frame.pos,                            visualFrameOrientation=quarternion)        collisionShapeId = p.createCollisionShape(shapeType=p.GEOM_MESH,                            fileName=part.collision_obj_path,                            collisionFramePosition=part.frame.pos,                            collisionFrameOrientation=quarternion)        bodyId = p.createMultiBody(baseMass=part.mass,            baseCollisionShapeIndex=collisionShapeId,            baseVisualShapeIndex=visualShapeId,            useMaximalCoordinates=True)        p.changeDynamics(bodyId,-1,activationState=p.ACTIVATION_STATE_ENABLE_SLEEPING,linearDamping=0.5, angularDamping=0.5)    startPos = [0,0,0]    p.resetDebugVisualizerCamera(cameraDistance=800, cameraYaw=60, cameraPitch=-60, cameraTargetPosition=startPos)    p.configureDebugVisualizer(p.COV_ENABLE_RENDERING, 1)    p.setRealTimeSimulation(1)        while True:    p.stepSimulation() </code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14226">bluefish_</a> — Sun Jan 23, 2022 11:39 am</p><hr />
]]></content>
	</entry>
	</feed>
