kbalage

LPub3d & LDCad - asking for help

Recommended Posts

I did not find an appropriate topic to raise this question so I hope it's not a problem to open one. I'm building a model in LDcad and trying to create the instructions with LPub3d. I have some pieces / parts of the model that needs to change position between steps, like pushing a 3L pin in place or rotating an assembly by an axle (like at the end of step 45 of 42077 A model). Is it possible to do with LPub3d? 

Edited by kbalage

Share this post


Link to post
Share on other sites

Thank you @roland for the hint! Based on what I read so far I'd need to switch to MLcad to use buffer exchange or add the necessary code directly with a text editor. If I understand correctly the support of buffer exchange is implemented already in LDCad as well, are there any instructions available how to use it?

I found some instructions for buffer exchange on this page, but when I opened the attached example file in LDcad I cannot really do anything with it, cannot select pieces etc. :cry_sad:

Share this post


Link to post
Share on other sites

That's because that model mixes part and model content, which is not supported in LDCad due to how rendering optimizations are done.

You can use buffer exchange in LDCad by using a source window combined with the special "LDraw meta items" part bin group (icon with the "...." speech bubble), which is located in the "special" group (Icon with many colored crosses). At the bottom of that group there are two items showing a brown box with an arrow point in and out, these are the store and retrieve commands.

Share this post


Link to post
Share on other sites

Amazing, many thanks for your help! Took a couple of minutes to figure out how to use it but succeeded at the end :) If someone needs the exact steps in the future I'll leave them here:

  1. drag & drop buffer exchange storage meta to the screen
  2. Add part in temporary position
  3. add next step
  4. drag & drop buffer exchange retrieval meta to the screen (part in temporary position disappears)
  5. Add part in final position

Share this post


Link to post
Share on other sites

As I'm experimenting with buffer exchange now in LDCad I encountered another challenge. I put a piece to a temporary position and I would like to move that to the final position only after several other steps. If I add the buffer exchange store/retrieval meta accordingly that means not only the piece I'd like to move will disappear but all the other pieces I added during the interim steps. Does it mean that I have to re-add those other pieces as well in the same position or is there another method to exclude the non-moving steps from the buffer exchange?

Share this post


Link to post
Share on other sites

That's indeed a limitation of the buffer exchange method.

As far I know most people usually solve it by using submodels for those collections of parts that need to be readded.

Alternative might be the "hide group" functionality of LPub, but that only supports MLCad groups. It will always be visible in the editors/viewers without LPub processing though.

Share this post


Link to post
Share on other sites

Thanks @roland, I guess I'll have to stick to a workaround then. About the meta items in LDCad like the buffer exchange - if I add them to a step they're not visible, only appear in the code. Is there a way to visualize these meta steps/commands in the application itself or I need to track them in the file itself?

One additional question (hope you're not too annoyed...) - I see there is a rotstep meta available as well, is there any documentation available how it works in LDCad?

Share this post


Link to post
Share on other sites

You can see/edit the LDraw code by opening a source window (View menu). I'll usually dock one at the right (keep ctrl down while moving the new window there)

LDCad allows all metas the ones in the bin are just the ones I thought are handy to be able to drag and drop. The fully supported metas have an editing window (press enter when the line is selected).

All steps (except the last one) can be turned into rotation steps by editing the current step (ctrl+b).

By default the rotations will not be applied while navigating steps, for this you must change the 'NSR" into "ASR" at the top right of the compass.

Share this post


Link to post
Share on other sites

Thank you guys, the workflow is much better this way! Having the source window there helps to control the metas. @roland is there a shortcut to jump to the current step in the source window?

Share this post


Link to post
Share on other sites
10 hours ago, kbalage said:

Thank you guys, the workflow is much better this way! Having the source window there helps to control the metas. @roland is there a shortcut to jump to the current step in the source window?

You can enable "Follow step", for this right click inside the source window somewhere there's no text. This opens the windows options menu.

Edited by roland

Share this post


Link to post
Share on other sites

Thanks again! Now I'm pretty much done with the things to do in LDCad, I wonder if the following things can be done in LPub3d (tried to look for the answer here and on the ldraw forum as well but no luck):

- Is it possible to add a circle to the page to highlight what part was added/changed like in the official instructions?

- Is it possible to zoom in with a defined center point? I found the option to scale the model which is almost good, but if the area I want to show better is not in the center then this solution is not suitable since it cuts off the areas not visible on the page.

Share this post


Link to post
Share on other sites

@kbalageAs far as I know neither thing is directly possible. One workaround is to use image import in LPub. You can draw a circle (PNG with transparent background) and overlay it with the model. You can also add a zoomed area (eg. from snapshot with LDView) to show local details. Not perfect, but...

Share this post


Link to post
Share on other sites
21 hours ago, kbalage said:

Thanks again! Now I'm pretty much done with the things to do in LDCad, I wonder if the following things can be done in LPub3d (tried to look for the answer here and on the ldraw forum as well but no luck):

- Is it possible to add a circle to the page to highlight what part was added/changed like in the official instructions?

- Is it possible to zoom in with a defined center point? I found the option to scale the model which is almost good, but if the area I want to show better is not in the center then this solution is not suitable since it cuts off the areas not visible on the page.

Both things can be done with LDCad + LPub3D, but are a PITA to do and are more of a hack than a real 'feature'.

For the first one, you can use buffer exchange like you use it with arrows. But, instead of an arrow you add a ring (I usually use ring10.dat from the official library, scaled up). It's very frustrating to place the ring in the correct spot though and it requires a bit of trial and error (and swapping between LDcad and LPub3D) to get the circle in the correct spot.

 

The 'hack' for the 2nd question is a little easier to implement, it just creates a mess in your file. LPub3D always zooms in on the center of the assembly image. So... the trick is to replace the center of the image. To do that you can place a random brick far far away from your model (in the direction you want to move the center of the image). I usually have to place the brick 1000-2000 LDUs away. You obviously don't want the random brick in your parts list or permanently move the image-center, so you have to wrap it in some buffer exchange. Then, the center of the image has been replaced and you can zoom in (scale) in LPub3D.

It's pretty easy to implement, but it gets annoying when you want to use this trick on multiple consecutive steps: you have to repeat the buffer exchange for every step. It's not a lot of work (just copy/paste), but it creates a god-awful messy file.

If only someone would ever create a new version of buffer exchange, so much things would become easier. The only thing we'd need is something like a 'buffer exchange end' command to tell the software where the buffer exchange ends. Then you could place a buffer exchange in step 10 and retrieve it in step 20 without constantly store/retrieving the same shit on every step. Then the software would know that steps 11-19 aren't part of the buffer exchange. Oh, and cross-submodel buffer exchange would be nice too :wink:

Share this post


Link to post
Share on other sites
10 hours ago, legolijntje said:

If only someone would ever create a new version of buffer exchange, so much things would become easier. The only thing we'd need is something like a 'buffer exchange end' command to tell the software where the buffer exchange ends. Then you could place a buffer exchange in step 10 and retrieve it in step 20 without constantly store/retrieving the same shit on every step. Then the software would know that steps 11-19 aren't part of the buffer exchange. Oh, and cross-submodel buffer exchange would be nice too :wink:

changing the spec is easy, changing all the programs currently supporting that spec takes ages :(

Share this post


Link to post
Share on other sites

@Philo the .png circle with transparent background works well, thank you! I can add this afterwards directly to the pdf, faster to move and resize then in Lpub3D.

@legolijntje I tried your suggestion with an extra brick moved further away to move the center point. It really moves the center of the image but in the same time it cuts off a significant part of the model that should be visible. 

This is the previous page where the extra brick is not added yet:

42077_test_page_72.jpg

This is the page with the extra brick. The center point moves properly towards the added pins as I wanted, but for me it seems that the whole rendered area moves as well to include the extra brick therefore the bottom part of the model is cut off. If I change the model scale the same amount of cropping remains.

42077_test_page_73.jpg

 

Share this post


Link to post
Share on other sites
23 hours ago, kbalage said:

@legolijntje I tried your suggestion with an extra brick moved further away to move the center point. It really moves the center of the image but in the same time it cuts off a significant part of the model that should be visible. 

This is the previous page where the extra brick is not added yet:

Hmm... :sceptic:

I only recently used this technique, but it was on a very big model. I did notice that I had to manually adjust the placement of the assembly image because it seemed cut off a little bit too much. I think it was actually the same problem as yours, but I didn't really experience it as a problem due to the size of the model.

And maybe it really isn't a problem with cutting off too much, but only a placement problem (pretty stupid nonetheless). When you place the assembly so that the cut lines up with the bottom of the page, that is the true placement. Then there's a lot of whitespace above the assembly, which means you can place your random brick closer to the model. Move closer until enough of the model is visible. Then move the assembly again so that the cut lines up with the bottom of the page and optionally copy/paste the placement to any next steps.

If that makes sense :wacko:

On 11-3-2018 at 8:32 PM, roland said:

changing the spec is easy, changing all the programs currently supporting that spec takes ages :(

Yeah, that's true. And for me personally, only LDCad and LPub3D have to support it. I don't use buffer exchange in any other programs. That sounds doable to me :wink:

Share this post


Link to post
Share on other sites
52 minutes ago, legolijntje said:

And maybe it really isn't a problem with cutting off too much, but only a placement problem (pretty stupid nonetheless). When you place the assembly so that the cut lines up with the bottom of the page, that is the true placement. Then there's a lot of whitespace above the assembly, which means you can place your random brick closer to the model. Move closer until enough of the model is visible. Then move the assembly again so that the cut lines up with the bottom of the page and optionally copy/paste the placement to any next steps.

If that makes sense :wacko:

 

If I move the random brick closer to the model that means the center point will go away again.. or maybe I didn't understand your process properly. Meanwhile I found a way to achieve what I wanted, this is also a painful workaround and will take tons of time to apply on multiple pages, but it works at least:

- change the page size to A2 (only the one to "zoom")

- rescale the model to fit the page

- export an image of the page at a high resolution

- change back the model scale to 1 and the page size to A4

- move the assembly image off-screen

- add the exported image to the page - it will be much larger than the current page so it is possible to choose a preferred center point. Some parts will hang over the edge of the page but when exported to pdf they will be cut off properly.

Share this post


Link to post
Share on other sites
On 3/10/2018 at 11:43 AM, Philo said:

@kbalageAs far as I know neither thing is directly possible. One workaround is to use image import in LPub. You can draw a circle (PNG with transparent background) and overlay it with the model. You can also add a zoomed area (eg. from snapshot with LDView) to show local details. Not perfect, but...

Philo, that is a good idea. I thought of it too. But, how do you go about creating the arrow or circle with a transparent background? 

Could someone with the know how please just put this ability to add an arrow or circle into the software, like LPUB3D or LDCAD.

Share this post


Link to post
Share on other sites
2 hours ago, 1963maniac said:

Philo, that is a good idea. I thought of it too. But, how do you go about creating the arrow or circle with a transparent background? 

Could someone with the know how please just put this ability to add an arrow or circle into the software, like LPUB3D or LDCAD.

This is likely something that will need to be done in a page layout software like indesign.

Share this post


Link to post
Share on other sites
On 3/1/2018 at 11:52 PM, kbalage said:

Amazing, many thanks for your help! Took a couple of minutes to figure out how to use it but succeeded at the end :) If someone needs the exact steps in the future I'll leave them here:

  1. drag & drop buffer exchange storage meta to the screen
  2. Add part in temporary position
  3. add next step
  4. drag & drop buffer exchange retrieval meta to the screen (part in temporary position disappears)
  5. Add part in final position

Thank you for simple yet effective guide. I actualy find it easier to do the buffer exchange later in LPub rather than in LDCad inserting the commands. I have few remarks that might help other people:

1) every part after 0 BUFEXCHG A STORE command is considered as buffered, so place parts that have to disapper at the end of step

2) you have to hide the part from PLI in the step where the part is in final position

So the example might look like this:

0 STEP
// here are parts that are placed in normal manner
0 BUFEXCHG A STORE		// parts below are placed temporary
1 71 260 -40 -200 -1 0 0 0 1 0 0 0 -1 32054.dat
1 71 -180 -40 -200 1 0 0 0 1 0 0 0 1 32054.dat
0 STEP
0 BUFEXCHG A RETRIEVE	// hide all parts in buffer
0 !LPUB PLI BEGIN IGN	// remove the parts from PLI
1 71 60 -40 -200 -1 0 0 0 1 0 0 0 -1 32054.dat
1 71 -60 -40 -200 1 0 0 0 1 0 0 0 1 32054.dat
0 !LPUB PLI END

 

Share this post


Link to post
Share on other sites
8 hours ago, Ivan_M said:

 


....
0 BUFEXCHG A STORE		// parts below are placed temporary
....

 

Be careful with those comments, not all software can handle trailing comments and or will preserve them.

Share this post


Link to post
Share on other sites

One more thing I would like to get help with - when I put subassembly into buffer exchange I end up with " build 2x" on page with subassembly, because it is in fact used two times. The trick with PLI IGN doesn't work. Any solution for this? Thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.