Those are all great ideas! It should be straight forward to make the guesser prioritize unofficial primitives over everything else when an unofficial element is being shown.
I have dug further into the idea of caching primitives client-side. Caching unofficial parts and primitives is a little troublesome since they might change, but caching official parts and primitives should be safe, right? This is what the ClientStorage.js does. I have updated the sample file to use this. It builds an "IndexedDB" store on the client with compressed geometries which are fetched before the code attempts to make a server call.
There is also an even more extreme measure (which can be turned off, of course): LDRGenerator.js. This generates the simplest of primitives directly in the code (like PrimGen2) and is even faster than the IndexedDB! Currently only 24 primitives are supported here, but this approach has great potential.
Oh. I almost forgot. The code not also supports high contrast studs and studs with logos (all 5 types of logos that are found in the LDraw unofficial primitives directory)
High contrast and logos can be configured using simple parameters:
ldrOptions.studHighContrast = 0; // Set to 1 for high contrast
ldrOptions.studLogo = 0; // 0 for no logo, 1 to 5 for logo types 1 to 5
I apologize for any typos. I was up the whole night because I got too deep into this... and it is quite fun.
I have dug further into the idea of caching primitives client-side. Caching unofficial parts and primitives is a little troublesome since they might change, but caching official parts and primitives should be safe, right? This is what the ClientStorage.js does. I have updated the sample file to use this. It builds an "IndexedDB" store on the client with compressed geometries which are fetched before the code attempts to make a server call.
There is also an even more extreme measure (which can be turned off, of course): LDRGenerator.js. This generates the simplest of primitives directly in the code (like PrimGen2) and is even faster than the IndexedDB! Currently only 24 primitives are supported here, but this approach has great potential.
Oh. I almost forgot. The code not also supports high contrast studs and studs with logos (all 5 types of logos that are found in the LDraw unofficial primitives directory)
High contrast and logos can be configured using simple parameters:
ldrOptions.studHighContrast = 0; // Set to 1 for high contrast
ldrOptions.studLogo = 0; // 0 for no logo, 1 to 5 for logo types 1 to 5
I apologize for any typos. I was up the whole night because I got too deep into this... and it is quite fun.