This is more of a data problem but you can try replacing the primitives
with their high resolution versions. Something like the attached patch
should work or you can edit your library directly.
Keep in mind that 3DS meshes have a limit of 64K unique verts so this won't
work on some baseplates.
I'm not sure what's the right way of using P48 instead of P, you'll
probably get seams in some meshes.
On Wed, Jul 10, 2013 at 12:44 AM, Nicolas Guilbert <[email protected]> wrote:
> I am currently experimenting with a workflow consisting of exporting Leocad
> meshes for rendering in Blender (using the 3ds or wavefront exports).
> However
> the exported meshes are too rough for my needs, I really would like to be
> able
> to use a variable number of polys, i.e. set the mesh resolution.
>
> Can this type of resolution be set in the Leocad UI? If not, whereabout in
> the
> code should I look?
>
> --
> Nicolas Guilbert
> Debian Maintainer for Leocad
>
> "Intelligence: property of a lifeform capable of outliving its planet of
> origin"
> _______________________________________________
> Leocad mailing list
> [email protected]
> https://list.gerf.org/listinfo/leocad
>
Index: lc_library.cpp
===================================================================
--- lc_library.cpp (revision 1403)
+++ lc_library.cpp (working copy)
@@ -206,8 +206,47 @@
}
else if (!memcmp(Name + 6, "P/", 2))
{
- lcLibraryPrimitive* Prim = new lcLibraryPrimitive(Name
+ 8, FileIdx, (memcmp(Name + 8, "STU", 3) == 0), false);
- mPrimitives.Add(Prim);
+ if (!memcmp(Name + 8, "48/", 3))
+ {
+ const char* PrimName = Name + 11;
+ lcLibraryPrimitive* Prim = new
lcLibraryPrimitive(PrimName, FileIdx, (memcmp(PrimName, "STU", 3) == 0), false);
+ bool Found = false;
+
+ for (int PrimIdx = 0; PrimIdx <
mPrimitives.GetSize(); PrimIdx++)
+ {
+ if
(!strcmp(mPrimitives[PrimIdx]->mName, PrimName))
+ {
+ delete mPrimitives[PrimIdx];
+
mPrimitives.RemoveIndex(PrimIdx);
+ mPrimitives.InsertAt(PrimIdx,
Prim);
+ Found = true;
+ break;
+ }
+ }
+
+ if (!Found)
+ mPrimitives.Add(Prim);
+ }
+ else
+ {
+ const char* PrimName = Name + 8;
+ bool Found = false;
+
+ for (int PrimIdx = 0; PrimIdx <
mPrimitives.GetSize(); PrimIdx++)
+ {
+ if
(!strcmp(mPrimitives[PrimIdx]->mName, PrimName))
+ {
+ Found = true;
+ break;
+ }
+ }
+
+ if (!Found)
+ {
+ lcLibraryPrimitive* Prim = new
lcLibraryPrimitive(PrimName, FileIdx, (memcmp(PrimName, "STU", 3) == 0), false);
+ mPrimitives.Add(Prim);
+ }
+ }
}
}
@@ -945,6 +984,9 @@
int lcPiecesLibrary::FindPrimitiveIndex(const char* Name)
{
+ if (!memcmp(Name, "48/", 3))
+ Name += 3;
+
for (int PrimitiveIndex = 0; PrimitiveIndex < mPrimitives.GetSize();
PrimitiveIndex++)
if (!strcmp(mPrimitives[PrimitiveIndex]->mName, Name))
return PrimitiveIndex;
_______________________________________________
Leocad mailing list
[email protected]
https://list.gerf.org/listinfo/leocad