Deleting or updating a line

Hi, how can I update the line end-position? On updating the end position, the lines are being aggregated to the scene as shown in fig. There are six such lines.

I want to update the end coordinates i.e. PH by moving the slider. A new line should be made, deleting old line…

var material, geometry1

function addline(PH){
	material = new THREE.LineBasicMaterial( { color: 0x0000ff } );
	points1.push( new THREE.Vector3( PH[0][0], PH[0][1], PH[0][2] ) );
	points1.push( new THREE.Vector3( 104.80, 771.82, 0 ) );
	geometry1 = new THREE.BufferGeometry().setFromPoints( points1 );
	line1 = new THREE.Line( geometry1, material );

function clearline(){

Possibly you can take something from it?
Construction of frames with contour/profile

This example works with variable lines: ConstructFrame . The scene is redrawn when the lines are changed.

line 375 function redrawSceneA( ) { ...

line 817 function createLinesLR( ) { ...

line 857

function onContainerBmouseDown( event ) { 
		... ... ...
		gLineL.attributes.position.needsUpdate = true;
		redrawSceneA( );

Also note in some places:
gLineR.attributes.position.needsUpdate = true;

(L left, R right)

Hi, can you please share the link to exact script file… I couldn’t find

If you search the web you will find

How to view the HTML source code of a web page


Use it for ConstructFrame

or directly

Why so, if you can update the end vertex of a line? Edit fiddle - JSFiddle - Code Playground


1 Like

thank you…