MoI discussion forum
MoI discussion forum

Full Version: Hidden line removal progress

Show messages:  1-2  …  203-222  223-242  243-262  263-282  283-296

From: Michael Gibson
19 Nov 2013   [#263] In reply to [#259]
Hi Max,

> Hi Michael, what I am talking about is: I made a simple cylinder and exported as DXF the front view.
> Then I open the DXF in MoI or AutoCAD. I notice that in some corners the lines aren't touching
> if I zoom closer. This brings me some issues for later, for hatching etc..

When you export to DXF format, the DXF export options dialog also has a "Canvas megapixel resolution" option in it - try increasing that from the default of 15 to something like 30 and that will increase the accuracy of the hidden line generation, you'll still have some gaps but they will be smaller.

I'm going to see if I can improve this further though. There will still likely be various kinds of cases where you will need to do cleanup of things in order to make a closed outer boundary for things like outlines where the outline is at a spot with multiple different surfaces all contributing to it.

For a cylinder case where it's one edge that's getting hidden because it's wrapping around to the hidden side, I think I can do something to get that situation tuned up without too much fuss though, I'll see.

- Michael
From: Michael Gibson
19 Nov 2013   [#264] In reply to [#260]
Hi Marc,

> One test got line segmentation with a model. It's a quick sketch though and maybe the edges are grazing.

Yeah it's fairly easy for that to happen when you've got 2 different solids that are kind of hanging out right on top of one another. If you get things like that booleaned together into one single object it should usually help to avoid it. There is some extra stuff in the hidden line removal processing that helps to avoid an edge getting submerged inside of surfaces that it's a direct part of - when you've got 2 separate objects just sitting next to each other that extra anti-stippling won't get engaged.

So for your particular case here, select these 3 objects up here:



Then do a Boolean union to get those combined together into one single solid. At this point MoI's viewport display may actually look slightly worse with some bleed through that wasn't happening before. But the hidden line export handles bleed through a lot better than the video card display does, and your actual PDF/AI export should not have bleed through and the stippling that you saw before should also be gone:





> One detail that might be nice: auto detection of a fullscreen viewport for the projection view dropdown menu.

Maybe I can add in a choice of "Active" in that Projection view dropdown that would then use the active viewport. The active viewport is the maximized one if there is a maximized view currently, otherwise in a split view it's the one your mouse is currently over or the last clicked one if your mouse is not currently over one.


It would be cool to see some nice test results too, not just bad ones! (bad ones are good for me to see too though of course) :)

- Michael

Image Attachments:
marc_stippling1.jpg  marc_stippling2.jpg 


From: Michael Gibson
19 Nov 2013   [#265] In reply to [#261]
Hi danperk, that's a great looking result!

> Did some testing with copy/paste into Illustrator CS6 and it works perfectly!
> If anyone missed it it's here:

A couple of other notes on copy/paste to Illustrator. There was a bug in the previous beta on the Mac for using AI format to copy/paste into Illustrator, that should be fixed now. The main difference with using AI format (instead of PDF) is that the layers come through when using AI format (if the setting for "Paste remembers layers" I think it's called in Illustrator is enabled).

Also, at least on CS2 there is a quirk for the shaded background image when doing AI version copy/paste - the actual image is stored in the temp folder, and it may not initially display in Illustrator for some reason. However, if you select the image and click the "Embed" button on the toolbar to switch it to an embedded image rather than a linked one, then it shows up.

So if you do AI version copy/paste into Illustrator use that embed button to get the background image to behave properly. It's pretty easy to select the background image because it's usually a fair amount bigger than the objects, just click a little away from the objects and it will select and the Embed button shows in the upper toolbar. It's possible this may not be needed anymore in recent Illustrator versions, I'm not sure about that.

- Michael
From: Martin (MARTIN3D)
20 Nov 2013   [#266] In reply to [#264]
Hi Michael,
quote:

It would be cool to see some nice test results too, not just bad ones!


sure, we just need some time to learn how to get good results. Hows about this :-)





-Martin

Image Attachments:
tremolo.png  vise.png 


From: Michael Gibson
20 Nov 2013   [#267] In reply to [#266]
Hi Martin,

> sure, we just need some time to learn how to get good results. Hows about this :-)

Tremendous! All the different ingredients (shaded background, silhouettes) just come together so well there.

It's so great to see these cool results, thanks very much for sharing them!

- Michael
From: mattj (MATTJENN)
20 Nov 2013   [#268]
Im using the new v3 beta on a mac with Mavericks and its not good. I can drag the moi window from one screen to another and the export function to ai or pdf stops after naming the file . .. anybody else have these problems?
From: run
20 Nov 2013   [#269]
Michael,

Something strange is going on with the Illustrator copy buffer in regards to Photoshop.

I know Photoshop hasn't been the direct target for this feature during developement, but it worked flawlessly with it in the previous(Aug 13th) beta.
Which isn't unexpected since copying and pasting curves between Photoshop and Illustrator has been a feature since at least since CS2.

The behavior is somewhat erratic, but most often when you attempt to paste in Photoshop, you'll get the paste UI as expected, but
when you choose 'OK' the following error is thrown, 'Could not complete the Paste command because the source rectangle is empty'
Any assortment of solids in Moi should demonstrate this issue.

Sometimes it will work correctly(not sure why), though if you use the 3D viewport as the source what you get in Photoshop is usually flipped vertically.

I've attached a .3dm that demostrates this last problem. Load it into the latest beta. Don't adjust the camera in any way and select the curves.
Copy it to the Illustrator copy buffer, with 'Projection View' set to '3D'. Paste into a Photoshop document as 'Path' or 'Shape Layer'; it will work but
the result will be flipped vertically. Now orbit the camera to a different position and try another copy/paste, sometimes this fixes things and sometimes it doesn't

This issue isn't a complete roadblock, you can paste to Illustrator then immediately copy and paste into Photoshop and everything works as expected every time,
so more like a construction detour blocking that nice shortcut you just discovered the other day.

-Jeff

Attachments:
photoshop_tester.3dm


From: Michael Gibson
20 Nov 2013   [#270] In reply to [#268]
Hi Matt, I think there are some problems in Mavericks with trying to move the window to different monitors. If I remember right, it's a general problem like the title bar gets lost or something like that, I'm a little surprised that it would have anything relating specifically to AI export.

But basically don't move the window to different monitors on Mavericks right now - Apple made a lot of changes to how multi monitor things work in Mavericks and it may take a while before fixes for the new problems that it caused trickle down into the libraries that MoI uses.

Does it work ok if you leave MoI on the same monitor instead of moving it to a different one?

- Michael
From: Michael Gibson
20 Nov 2013   [#271] In reply to [#269]
Hi Jeff,

re: 'Could not complete the Paste command because the source rectangle is empty'

Does this happen only if you are generating a shaded background image? When the dialog comes up at export time, try unchecking the "Shaded background" checkbox to do a curves only export without any image. Does the problem still repeat when doing curves only or not?

There were also a couple of changes in this new beta to put a bit more assorted information (like hi res bounding box, AI file version number, a couple of things like that) into the header part of the AI file, if you still see the problem without any image then it's probably related to that.

- Michael
From: wastzzz
20 Nov 2013   [#272]
Damn! That Floyd Rose is so appealing to my eyes I wanna eat it! Nice job. :)
M.
From: MajorGrubert (CARLOSFERREIRAPINTO)
20 Nov 2013   [#273]
Hi Michael,

> i'm only able to output the 3D view

I think i've found the reason for this behaviour: It happens when using MilkyWaif UI, the export options window popup that show up its different from the actual (v3 Beta Nov.) and always export only the 3D view.

With the default UI it work nicely. So, i'll stick with the default UI, although i loved MilkyWaif UI.

Thanks.

Carlos
From: Michael Gibson
20 Nov 2013   [#274] In reply to [#273]
Hi Carlos, yeah you can't really copy old versions of the full UI over top of a new release, when you do you're effectively erasing any changes that were implemented for new features.

Like in this case the AI dialog is pretty different compared to the old version, because there are a lot of new options for it to control.

Instead of copying the entire \ui folder over (which for sure will cause problems), you could instead try to only copy a small number of key files like moi.css and specific images that were changed, that has a better chance at working but even then if the new release has changes to moi.css which happens sometimes you will still run into the same problem.

This problem of trying to incorporate UI changes for new features along with personalized changed to previous UI is a kind of difficult problem to solve, it's one of the reasons why I have not really focused on UI customization so much.

- Michael
From: run
20 Nov 2013   [#275] In reply to [#271]
Hi Michael,

>Does this happen only if you are generating a shaded background image?

It's inconsistent. If turned off, solids will sometimes stop throwing the error but the result is still flipped vertically.
Turn it back on and it continues to NOT throw the error. Orbit the camera, still okay. Orbit the camera some
more and eventually it starts throwing the error again. It's weird, it's almost like the buffer data gets corrupted
at least in regard to Photoshop. And once that happens it keeps throwing the error and doesn't care whether
the background image is on or off.

The previously attached .3dm is curves only and should always paste, albeit flipped, but sometimes curves only
will also throw the error if selected curves match the edges of unselected surfaces.

-Jeff
From: mattj (MATTJENN)
20 Nov 2013   [#276]
Hi michael

Yes it seems to be mavericks, if i leave on one screen it is more stable. I read that cranking up the canvas mega pixel value gives more detail, and in doing so it does give me a better pic, at 30 it works but at 35 it crashes every time. I have attached two pdfs a MOI version and an Isodraw version to compare. I know its unfair to compare you to such a mature product, what you've done so far is brilliant.
It seems some of the "weak" areas highlighted in pink need more resolution from the pixel grid to work but as i say it won't go above 30 without crashing. . . FYI the size of this part is approx 60cm square if that helps.

Matt

Attachments:
inertSep-isodraw.pdf
inertSep-MOI.pdf


From: Mike K4ICY (MAJIKMIKE)
20 Nov 2013   [#277] In reply to [#272]
> Damn! That Floyd Rose is so appealing to my eyes I wanna eat it! Nice job. :)

With this new ability, MoI has just increased its street-value many-fold! (er, ya know what I mean)

Martin, those are beautiful, and the new output is amazing!
From: Martin (MARTIN3D)
20 Nov 2013   [#278] In reply to [#277]
Thanks wastzzz and Mike.

I wasn't that happy with the export results yesterday. Luckily it was me. Now that I run "Construct > Curve > Isect" before each and every export its like night and day.
Excellent work Michael, MoI has become so much more useful.
From: Michael Gibson
20 Nov 2013   [#279] In reply to [#275]
Hi Jeff, re: Photoshop copy/paste problems, can you please contact me through e-mail at moi@moi3d.com and I'll set up a test version for you which reverts some of the changes to the header part of the AI file generation. It seems like Photoshop probably has some bugs in its handling of the old AI v8 file format, but if it worked ok previously it should probably be possible to get it to work again if I just avoid writing whatever particular thing triggers the bug from happening.

- Michael
From: Michael Gibson
20 Nov 2013   [#280] In reply to [#276]
Hi Matt,

> It seems some of the "weak" areas highlighted in pink need more resolution from the pixel grid to
> work but as i say it won't go above 30 without crashing. . . FYI the size of this part is approx 60cm square if that helps.

Right now the hidden line export will crash if it runs out of memory in the middle of the calculation. For the next release I'll try to tune this up to try and make it behave better like maybe just giving up on the export rather than crashing. But anyway that's almost certainly what's happening to you with the canvas size above 30 megapixels combined with a highly detailed model.

If you haven't tried this already, go to Options > View > "Meshing parameters", and set the "Mesh angle" parameter to 30 degrees, and uncheck the "Add detail to inflections" parameter right next to it (do this with MoI empty just after startup). That will make for a rougher looking viewport display but it will reduce memory consumption by quite a bit on heavy models like you've got there.

That might allow you to go up higher with the canvas size setting, which can have a max value of 75.

The overall approach of how the hidden line engine works just might not work very well with that kind of object structure where you've got such little tiny sized edges in comparison to the whole overall object size. If you can possibly cut the model up into some smaller sized pieces and only process one of those pieces at a time rather than a big sized chunk like that, that would probably help quite a bit.

Two of the areas where you've circled where there are little things shooting out - those are probably not actually related to canvas pixel size but are more likely to be surface trim problems where there was some problem getting a proper structured trim boundary during the STEP file import. Those particular surfaces will probably have to be repaired by separating them out, untrimming and retrimming them in order to get them fixed up. If you're able to send me a file with just those problem surfaces and the ones immediately surrounding them I can try to show you how to do that. There is an object repair tutorial here that covers some of the techniques involved: http://moi3d.com/forum/index.php?webtag=MOI&msg=446.17 It's also possible that it could be a mesh generation bug rather than an incorrect trim boundary import bug, it's difficult for me to know for sure without examining the actual geometry.

At any rate, the MoI export you show there even with its flaws at least gives you something that you can work with. I'll see about doing some tuneups to try and improve it further.

- Michael
From: Mike K4ICY (MAJIKMIKE)
20 Nov 2013   [#281]
Hi Michael,
This new feature indeed has great promise!

I was able to export my very complex model by turning off inflections and bringing the mesh angle up to 30.
I also had to delete every non-essential and hidden object as the process seemed to include them in the calculation.
Yes, that is how it works, but I think those objects were gumming up the works even though they were "hidden."
Does the PDF export omit hidden objects from the equation?

Also, I would like to suggest and addition to this feature: Could there be a way to use a blank white or solid-color vector object in place of the bitmap?
Or could there be a way to tell the 'background' bitmap to be white without disappearing and showing the outlines beneath?
The bitmap can be whitened out in Illustrator or Corel, but Photoshop hasn't a way to see these layers when importing PDF's.

Case in point: I'm often interested in making the plain, diagram-style vector pics using no fill color, but still blocking out the larger outside outlines.
I could program in a Lighting Option to make everything white... hmm, easier in AI or Corel.

Here is a cool result:



I brought the PDF into Corel where I made the bitmap white. Then I converted everything in a line-art bitmap where I used Corel's auto-trace feature on it.
That gave me a hand-inked look! Added the type next and brought all that to PhotoShop where I gave it all a realistic look.

Again, I am very pleased with the prospect!
From: milkywaif
20 Nov 2013   [#282] In reply to [#281]
Very cool result Mike!

Show messages:  1-2  …  203-222  223-242  243-262  263-282  283-296