LDraw.org Discussion Forums
LDCad 1.2 Public Alpha 1 - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html)
+--- Thread: LDCad 1.2 Public Alpha 1 (/thread-8284.html)

Pages: 1 2 3 4


LDCad 1.2 Public Alpha 1 - Roland Melkert - 2013-02-16

Took me awhile but here's the first test version of LDCad 1.2.

It's major new features are templates and highly configurable flexible parts.

Do note this is an Alpha version, meaning it is not jet feature complete. Although all core functionality is working I'm still working on some additional support features I'm hoping to offer in the next version.

As a result working with the new flexible parts requires some expertise for now. I'll try to give some quick pointers here to get you started:
  • Start a new model like in previous versions.
  • Locate the 'templates' group in the bin and navigate around in it to select a template (e.g. pneumatics/hose)
  • Drag the part to your model like any other part.
  • A dialog will ask if you want to create a submodel (mpd) or new file (ldr), choose one.
  • The template will be copied into the target model and a reference to that new model will be added to the current model.
  • You can now move it around like any other part/submodel and edit by double clicking it.

When editing the tube itself you can bend it's path by moving and or adding points around. The simplest way to do this is by selecting a point and pressing the insert key. A new point will be added AFTER the one you selected, but also always before the last point on the path.

While editing a path there are some general guidelines which should make things easier (until the support features I mentioned above are ready).
  • Keep track of the #1 point it should remain at 0,0,0 for ease of use.
  • When shaping the part, you are working blind for now. So use the 'end' key to swap between models to see the path in relation to the higher model.
  • Generally you want to position the start of the path using the reference in the higher model using it, when that's done move the last point of the path to the destination location using the paths own session.
  • When start and end points are positioned correctly, select the first point again and start inserting extra points to guide the path to it's goal.
  • Rotate a point to change direction and shape bends using the green and red spheres.
  • Use ortho mode whenever possible, it offers much better insight about direction and makes using the grid easier.
  • Use 'p' (show/hide editing pin), 'g' (show hide grid for selection), 'o' (change grid orientation to match the selection), 'i' (show hide the info panel), 'r' (rotate mode) and 'm' (move mode) instead of the mouse whenever needed.

I think this should get you started, I could probably write a book about the path options themselves, but for now I'm limiting this novel to using template based paths. If you're brave enough to try and create a custom part, you can do so via 'file/new...' and the special 'path' group in the special parts folder. I'll write a better guide if needed, just ask.

Ok, here are the downloads. They are all archive (standalone/portable) versions and I recommend you use them separately from any other LDCad installation.

LDCad-1-2-Public-Alpha-1-Linux-32.tar.bz2
LDCad-1-2-Public-Alpha-1-Linux-64.tar.bz2
LDCad-1-2-Public-Alpha-1-Win-32.7z

Some caution, I haven't had time to really test the Linux versions, but they should work ok. Please let me know if they act especially weird or something.

Some screenshots:

[Image: 1-2-PA-1-a.png]
[Image: 1-2-PA-1-b.png]
[Image: 1-2-PA-1-c.png]

I've also attached the mpd shown in these screenshots, to prove any LDraw renderer should be able to show the flexible parts.

In closure please remind this is a test/alpha version so any comments and bug reports are welcome ether here or by direct email (see www.melkert.net/LDCad for my email address )

I'm especially curious about what experienced part authors have to say / think about the collection templates / path options, because they are in many ways just like official parts.


Re: LDCad 1.2 Public Alpha 1 - Travis Cobbs - 2013-02-16

I have a few observations based on looking at your sample model in LDView. My first observation is that, once LDView has a bug fixed, your hoses will look much nicer in LDView if you add a line to the top of their definition saying "0 Unofficial Part". This will cause LDView to treat the hose as a part, and therefore perform smoothing on it.

Currently, there is a bug in LDView that causes really bad results with your hoses after doing this. However, I am working on a fix for this bug, and while I'm not currently happy with the performance of my fix, it does basically work. While doing this, I discovered that your hoses are missing conditional lines between the segments. Adding those would cause the smoothing to look really good (with my LDView fix).

Another problem is that you split quads into two triangles prior to doing the deformation, and the deformation can result in output where the two triangles that make up the quad have different normals. These triangles should have a conditional line added between them.

Note: My LDView bug is that if the two triangles ARE co-planar, LDView doesn't treat them properly, and ends up producing very bizarre smoothing results. My tweak to fix that is to add fake conditionals between adjacent co-planar polygons (just for smoothing) in order to make my smoothing algorithm work better. While testing my fix, I had to set the tolerance when checking if two normals are "equal" to a fairly loose value (.02 for each of the x,y,z components of a normalized vector wasn't quite loose enough; .1 caused excessive smoothing).


Re: LDCad 1.2 Public Alpha 1 - Travis Cobbs - 2013-02-16

Philo: I seem to remember you reporting this LDView bug. Do you have any parts that I could test my fix against?


Re: LDCad 1.2 Public Alpha 1 - Philippe Hurbain - 2013-02-16

Hi Travis,
Sorry, I'm not home now, so I don't have examples at hand...
Quote:My LDView bug is that if the two triangles ARE co-planar, LDView doesn't treat them properly, and ends up producing very bizarre smoothing results.
...but basically, yes, it's the problem. For a structure like this tube, it results in a weird twisted look. Creating "virtual" condlines in planar areas will definitely improve smoothness of many parts! I have been tempted so many times to introduce condlines in planar areas to avoid this kind of problems...
Quote:(.02 for each of the x,y,z components of a normalized vector wasn't quite loose enough; .1 caused excessive smoothing)
Do you have a rough value of facets angle that will trigger this smoothing? Presently Edger2 defaults to create condlines above 0.1°. If I set the correct default value, "virtual condline" will do the smoothing job below the threshold, and real one will do above.


Re: LDCad 1.2 Public Alpha 1 - Roland Melkert - 2013-02-16

Travis Cobbs Wrote:if you add a line to the top of their definition saying "0 Unofficial Part". This will cause LDView to treat the hose as a part, and therefore perform smoothing on it.

Is it ok if this line follows after "0 !LDCAD GENERATED" (but before the bfc one) making it part of the maintained code block. Or does LDView stop processing the header as soon it finds non header metas or something? You could also add it to the template as a workaround in the current version though.

Travis Cobbs Wrote:While doing this, I discovered that your hoses are missing conditional lines between the segments. Adding those would cause the smoothing to look really good (with my LDView fix).

That should be forced by adding those type 5 lines in the donor, only downside is they will cause duplicate lines for all but the last segment. Although I probably be able to add detection for that without too many costly vertex compares. Next Alpha will have a custom donor (with minimal geometry) for hoses I'll make a note to add those lines in those files.

Travis Cobbs Wrote:Another problem is that you split quads into two triangles prior to doing the deformation, and the deformation can result in output where the two triangles that make up the quad have different normals. These triangles should have a conditional line added between them.

So basically I need to add a conditional line between split quad triangles if the angle between their normals is below a certain (0.02 deg or dot prod ?) value?


Re: LDCad 1.2 Public Alpha 1 - Travis Cobbs - 2013-02-17

The "0 Unofficial Part" can be anywhere in the definition at all (including the very end), and LDView will still treat the "file" as a part. However, it's probably best to put it near the top somewhere.

I don't think you can put the conditionals in the donor part, because the control points going to the next segment depend on the location of the points in the next segment.

My current "normals are approximately equal" check doesn't involve the angle between them at all, but checks the x, y, and z coordinates of both (normalized) normals to see that they are within some threshold. I wanted to test the new code quickly, and that was the fastest way to do so. I'll update it to do the dot product, then choose an appropriate threshold (perhaps 1 degree). Note that if I set my current threshold to .1, visually I can see that surfaces with 10-20 degree angles between them get smoothed, so 1 degree may not be as unreasonably big as it sounds.


Re: LDCad 1.2 Public Alpha 1 - Travis Cobbs - 2013-02-17

I just set the angle threshold to 1 degree, and it looks fairly reasonable. Here is the hose in standard view:
[Image: iMg0yaq.png]
And here it is from another angle, zoomed in. You can see the weird pattern where the missing conditional lines lead to problems:
[Image: Xd3Aq6D.png]


Re: LDCad 1.2 Public Alpha 1 - Philippe Hurbain - 2013-02-17

This is great! Could you share a beta including this feature?
If the "planar smoothing" occurs below 1°, I'll let edger2 minimum threshold to present 0.1°, at 1° condlines are sometimes missing on edge of shapes, in their original purpose...


Re: LDCad 1.2 Public Alpha 1 - Roland Melkert - 2013-02-17

Travis Cobbs Wrote:I don't think you can put the conditionals in the donor part, because the control points going to the next segment depend on the location of the points in the next segment.

The control points are being transformed just like all other points but you are right this will go wrong (or less accurate) for control points whom overlap into another segment. I could account for that though, I'll look into that for the next version. I was already considering it at one point for instances the donor it self has overlap with other segments. I decided against that feature because of all the extra buffering / matrix operations required for it to work properly. But limiting it to just the type 5 control points might be acceptable.

Thanks for your tests I would very much like to see these generated parts at their best in LDView Smile


Re: LDCad 1.2 Public Alpha 1 - Ignacio Fernandez Galvan - 2013-02-17

Just tried the linux-64 version. I could see the templates, but then closed the program, opened it again, and the templates are all red crosses. So deleted the directory and this seems reproducible:

1. Start LDCad, select the LDraw directory, select the templates bin (no need to select "new" or "open"). The templates appear.
2. Close LDCad.
3. Start LDCad, select the templates bin. Just red crosses.

I'd say there's something wrong either in my system or in the default path for the templates. More investigation reveals that:

4. Close LDCad. Delete config/templates.inv.
5. Start LDCad, select the templates bin. The templates appear again.

The paths in templates.inv look OK, though.