Cap only one side of CylinderGeometry?

Is it possible to cap only one side of CylinderGeometry? As the openEnded property affects both ends.
Thanks!

You can use a transparent material.

2020-10-22 20.30.37

var uvTex	= new THREE.TextureLoader().load( "uvgrid_w_0_9 .jpg" );

var materials = [

	new THREE.MeshBasicMaterial( { map: uvTex, side: THREE.DoubleSide } ),
	new THREE.MeshBasicMaterial( { map: uvTex, side: THREE.DoubleSide } ),
	new THREE.MeshBasicMaterial( {color: 0xffffff, side: THREE.DoubleSide, transparent: true, opacity: 0 } ),
	
];

var geometry = new THREE.CylinderBufferGeometry(80, 80, 80, 10, 1 );

// mesh
var mesh1 = new THREE.Mesh( geometry, materials );
scene.add( mesh1 );
1 Like

Thanks! This works :slight_smile:

According to the doc this is rendered with 3 draw calls though.

The OP might want to consider to create the geometry in Blender if the additional overhead is unwanted.

3 Likes
  • OK: use Geometry.
  • Better: write a function that generates geometry with opts ( caps, volume, etc )
  • Best: write a function that deletes unwanted faces.