nexus icon indicating copy to clipboard operation
nexus copied to clipboard

problem converting ply with attribute based on 4 components RGBA

Open ua4192 opened this issue 2 years ago • 9 comments

Hi Federico.

As I am having problems with the nxsbuild version that allow to convert glb files and came back to the default nxsbuild that support only ply and obj formats.

I have modifued the PLYExporter.js and PLYLoader.js from THREEJS libraries in order to export the color attribute with 4 components instead the 3 that come by default.

I am able to export the ply and load them again without any problems but the nxsbuild command fails.

Fatal error: virtual memory error mapping block: access is denied

As I am no able to attach the ply here, I will send it to you by mail if you can provide me a mail address.

Many many thanks for your support Best regards

ua4192 avatar Jan 13 '22 10:01 ua4192

Hi Federico.

I sent you the ply file by mail.

Best regards

ua4192 avatar Jan 14 '22 14:01 ua4192

Hi, Meshlab complains about bad index (out of range of the vertices array). I am afraid this file has some problems too...

ponchio avatar Jan 14 '22 18:01 ponchio

Hi Federico.

I will have a look on the files on Monday and will come back to you.

Many thanks for your support.

ua4192 avatar Jan 15 '22 12:01 ua4192

Hi Federico.

I have finally ended to conver my ply file with rgba attributes.

If I use the nxs file it works properly but if I conver the nxs to nxz using the command: nxsedit test.nxs -o text.nxz -z -C 8 or nxsedit test.nxs -o text.nxz -z -C 8 -A 8 or nxsedit test.nxs -o text.nxz -z -C 8 -A 8 -Y 8

The alfa attribute is not properly retrieved giving me wrong values.

I am using 8 bit (Uint8Array(4*nvertices)) in my ply file

Maybe this error has been already fixed in the last release (not yet in releases section on github)?

Still looking forward for this new compilation on github.

Best regards and as always many thanks in advanced for your support.

ua4192 avatar Feb 03 '22 11:02 ua4192

Hi, I tested a bit and it looks like the problem is not in the nxsedit compression but in the javascript. corto.js just decodes the first 3 colors. corto.em.js (the emscripten, way faster javascript lib), works properly insted.

I guess you are still using corto.js, (which is for example used in older 3DHOP version, the latest should use corto.em.js).

If this is still not the case, could you provide me a full sample to debug the issue?

ponchio avatar Feb 04 '22 15:02 ponchio

Hi Federico.

I have just check my libs and I think I am using corto.em.js.

I had a look in my nexus.js library and here you can see:

var corto = null;
function loadCorto() {

	corto = new Worker(path.replace('nexus.js', 'corto.em.js'));
	corto.requests = {};
	corto.count = 0;
	corto.postRequest = function(node) {
		corto.postMessage({ buffer: node.buffer, request:this.count, rgba_colors: true, short_index: true, short_normals: true});
		node.buffer = null;
		this.requests[this.count++] = node;
	}
	corto.onmessage = function(e) {
		var request = e.data.request;
		var node = this.requests[request];
		delete this.requests[request];
		node.model = e.data.model;
		readyNode(node);
	};
}

About the example I will try to make one for you. The current file I am using it's about 400MB

Best regards

ua4192 avatar Feb 07 '22 06:02 ua4192

You can use nxedit with the --size option to truncate the model to a reasonable size (while keeping everything else as the original).

On Mon, Feb 7, 2022 at 7:10 AM Alex @.***> wrote:

Hi Federico.

I have just check my libs and I think I am using corto.em.js.

I had a look in my nexus.js library and here you can see:

var corto = null; function loadCorto() {

corto = new Worker(path.replace('nexus.js', 'corto.em.js')); corto.requests = {}; corto.count = 0; corto.postRequest = function(node) { corto.postMessage({ buffer: node.buffer, request:this.count, rgba_colors: true, short_index: true, short_normals: true}); node.buffer = null; this.requests[this.count++] = node; } corto.onmessage = function(e) { var request = e.data.request; var node = this.requests[request]; delete this.requests[request]; node.model = e.data.model; readyNode(node); }; }

About the example I will try to make one for you. The current file I am using it's about 400MB

Best regards

— Reply to this email directly, view it on GitHub https://github.com/cnr-isti-vclab/nexus/issues/133#issuecomment-1031107638, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUDV26XBMSPAAHCAYXBZYTUZ5O4XANCNFSM5L3ORTAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

ponchio avatar Feb 08 '22 00:02 ponchio

Hi Federico.

My problem is that my company proxy constraints don't allow me to update any file via github.

My only option is to send the file by mail.

I guess you need the ply file, don't you?

If this is the case the option you have mentioned that is for reduce the size of nxz file is not valid for me, isn't it?

Best regards and many thanks as always.

ua4192 avatar Feb 10 '22 14:02 ua4192

If the problems happens between nxz and nxs, I just need the nxs and the nxz (so I can compare with my nxz version). And I would need a sample of the rendering code (html+js), so I can quickly check if the problem is in nxs or in the js.

The options I mentioned (--size, allows you to cut the size of the nxs (end than create also the nxz from it) to a manageable size and send it by mail (the alpha problem doesn't seem to be related to size).

ponchio avatar Feb 10 '22 16:02 ponchio