MoI discussion forum
MoI discussion forum

Full Version: "make2d" oddities

From: Ad (JUSTABLE)
27 Mar 2023   [#1]
MOI V.4 and V.5 Beta

The results from using the make2D script are giving me
some unexpected results. See attached screenshots.
sample-01 shows the vertical hidden lines are not fully
extending to the visible part of the hole. There are some
short line segments (I changed color to red) to fill the gap
though. I get the short visible (red) segments even if I
uncheck the "create hidden lines" option.

Sample-02 shows another problem. Again the script creates a
short little segment that is disconnected from the main curve.
Sample-03 shows the opposite side of the hole, but this time
the visible line goes too far. Sample-02 and -03 shows detail
of holes in the vertical leg seen in Sample-04.

Not sure if there are any settings to avoid those cases. Changing
the predefined resolution to a much smaller or bigger value does
not solve the problem. But to my understanding the resolution only
affects the smoothness of the curves?

Just wanted to mention that the above mentioned problems occure
no matter if I create my 2D geometry with "make2D", "make4views"
or by saving directly to pdf/ai? This is a consistent problem not
only related to the part shown.














Image Attachments:
sample-01.png  sample-02.png  sample-03.png  sample-04.png 


From: Michael Gibson
27 Mar 2023   [#2] In reply to [#1]
Hi Ad, can you please post the .3dm model file that the screenshots are taken from?

That would make it a lot easier to be able test possible tune ups.


> Not sure if there are any settings to avoid those cases. Changing
> the predefined resolution to a much smaller or bigger value does
> not solve the problem. But to my understanding the resolution only
> affects the smoothness of the curves?

The Resolution controls the density of the zbuffer pixel grid used to determine visibility, and increasing it to around say 60 or so should usually help with these issues.

Another thing you can try is make the overall object scale around 10 to 30 units across and not have things that are a lot smaller or larger in size than that.

If you are generating it on a perspective 3D view make sure the object is framed well inside the viewport and isn't only taking up a small portion of the viewport.

It's difficult to give advice without being able to test with the actual file though.

- Michael
From: Ad (JUSTABLE)
28 Mar 2023   [#3] In reply to [#2]
Hi Michael,

Initially I created the 2D geometry in the context of an assembly. Just highlighted the bracket and ran "make2D".
And this created the results I posted in my previous post.
This time I separated the part, copy and paste into new file, and ran the script again. Not really much of a difference.
The only improvement I get from this, the little hidden line segment as shown in sample 2 is gone now.
I also just created a box with a thru hole, just to see what this does, but I had the same issues with that part.

Any ways, attached is the part file as requested, it is only the part by itself. And I will play some more with the other
suggestions you made.

Thanks for taking the time to look into this.

Attachments:
bracket.3dm


From: pressure (PEER)
28 Mar 2023   [#4] In reply to [#3]
Hi Ad,

Re:
> I get the short visible (red) segments even if I
> uncheck the "create hidden lines" option.

My experience is that these sort of lines are unavoidable. They get shorter as canvas megapixel resolution is increased, so I usually use 200 which is limited by the RAM I have, but I've never figured out a way to eliminate them entirely. They seem to happen wherever a hidden radiused surface like a hole or a fillet meets a visible surface.

I just delete these fragments manually one at a time since where they occur is predictable.

- Peer
From: Ad (JUSTABLE)
28 Mar 2023   [#5] In reply to [#4]
Hi Peer,

Yeah, you are probably right, those artefacts are unavoidable. I played around with the part some more.
Scaled it up by a factor of 100, but this gives me similar results, in some areas better, in other areas worse.

Yes the location of the problem area is predictable, and I did some manual clean-up before, but this is
getting tedious, if you have a lot of parts. I wanted to use the ISO views in inkscape, but in order to apply
a fill to the individual faces, you need to have closed curves. So under certain circumstances a lot of trimming,
extending and joining curves is neccessary.

Well, just trying to find a way to speed up the process.

Ad
From: Michael Gibson
28 Mar 2023   [#6] In reply to [#5]
Hi Ad, your object is a bit on the small side, I would scale it up by 20x (select, run Transform > Scale, type 0 <enter> to specify 0,0,0 as the scale origin then type 20 and push enter).

i did that and set Resolution to 50 to make this attached result.

- Michael

Attachments:
bracket2.3dm


From: bemfarmer
28 Mar 2023   [#7] In reply to [#6]
It is really cool to see the 2D Top view which looks like a 3d image.

For bracket of size 39.51 X 53.3817, I am still seeing 6 short line segments with lengths of 0.1319 to 0.1708.

Isn't there a script to find and remove very short curves?

- Brian

In Burr's script list I see: ShortestSeg.js

There are a couple of very short curves that should stay. They can be joined. Then the ShortestSeg script finds one of the short curves to be deleted...
From: Michael Gibson
28 Mar 2023   [#8] In reply to [#7]
There's also a select by length script here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=7927.2

- Michael
From: bemfarmer
28 Mar 2023   [#9] In reply to [#8]
That is a good script.

In Burr's script list, there is also "SelectAllLengths.js."

Maybe one of those 3 scripts, or some combination, could have some user size entry input added?

- Brian
From: bemfarmer
28 Mar 2023   [#10] In reply to [#8]
After a join, I tried your linked script, with min 0.0 and max 0.2, which identified 7 segments for deletion.

- Brian
From: Ad (JUSTABLE)
29 Mar 2023   [#11] In reply to [#6]
Hi Michael,

Thanks for the file. I looked at it, but like bemfarmer already mentioned, it still does not
quite give me the desired results. I will play around with those additional scripts you mentioned.

Are there any plans to work on this in the future. In my case it would be nice to have a clean output
in one go. But this is probably not something most users require.

Ad
From: pressure (PEER)
29 Mar 2023   [#12] In reply to [#11]
Hi Ad,

You might give Rhino a try since someone else on this forum said that v5 didn't have these problems:

http://moi3d.com/forum/lmessages.php?webtag=MOI&msg=6201.288

I delete the fragments manually because I have found that a silhouette that ends in the middle of a double-curved surface has a similar artifact where it ends, and that the piece that should be hidden, but is rendered as visible, is joined to the rest of the silhouette curve and so isn't a "short" curve that can be found with a script.

But, if the problem is basically that you want to get closed curves that can be filled, I recommend Adobe Illustrator's LivePaint. It does a good job even when there are little gaps and other problems. Expanding the LivePaint group gives closed shapes that can be stroked, offset, filled with a gradient, etc. You might also try Inkscape's Fill Bounded Areas if you haven't already. The way it works is pretty different from LivePaint and so the results aren't as good, but it might get the job done.

- Peer
From: Michael Gibson
29 Mar 2023   [#13] In reply to [#11]
Hi Ad,

re:
> Thanks for the file. I looked at it, but like bemfarmer already mentioned, it still does not
> quite give me the desired results. <...>

It's a step closer to your desired results because several of the problems you originally noted are not there.

If you generally keep objects to be exported about the size I showed it should help some.


> Are there any plans to work on this in the future. In my case it would be nice
> to have a clean output in one go. But this is probably not something most users
> require.

It's a tricky area because it's very easy for a fix that solves one problem to cause a new problem somewhere else.

But if you report problems especially providing a .3dm file so I can reproduce it then that can help me to work on tuneups.

Maybe some different behavior specifically for silhouette curves would help, something like don't try to determine visibility on a silhouette curve until it has taken a few steps already.

- Michael
From: Ad (JUSTABLE)
29 Mar 2023   [#14] In reply to [#13]
Hi Michael,

>It's a tricky area because it's very easy for a fix that solves one problem to cause a new problem somewhere else.<

I see what you are saying :). Your solution works. Scaling the model up and changing the resolution makes those short
segments almost invisible, or invisible enough to get away with it, in most situations. In my case it might actually be
easier to not scale the model, so it is easier to spot the problem areas and fix them.

Another thought that came to me, would it be possible to automagically have all the line segments, that surround each
face joined. I probably should make a screenshot to show what I mean. Or is there a way to loop select edge loops on 2D
entities. I know there is script that works on faces. I am just trying to avoid to chase files from one program to another,
and Moi just has a nice workflow.

@Peer, yeap LivePaint works really very well, played around with this too. Corel Draw has a similar function, I think it's
called FloodFill, not sure right now, also works well. Inkscape solution works, but this is really not there yet :(. FreeCad was
another thing I tried (Tech Draw Workbench), this gave me the proper result, but, FreeCAD is a "Beast", if you know what I mean.
It is loaded, but simple things are sometimes better/easier/faster. Right now I am just exploring my possibilities and looking
for the best solution.

Sorry for the long post.
Ad
From: Michael Gibson
29 Mar 2023   [#15] In reply to [#14]
Hi Ad,

re:
> Another thought that came to me, would it be possible to automagically have all the line segments,
> that surround each face joined.

Pretty difficult to make that happen currently at least. To start with as you have noted there are often little pieces which are hard for a joiner to process automatically.

Additionally on edges shared between 2 faces those would need to be duplicated?


> I probably should make a screenshot to show what I mean. Or is there a way to
> loop select edge loops on 2D entities.

Sorry, no there isn't that kind of loop selection available currently.

- Michael
From: Frenchy Pilou (PILOU)
29 Mar 2023   [#16]
And why not use the PDF export from MOi3D ?
Seems you have the same different projects view 3D of any position of the object in the 3D SPace to the flat sheet !
and seem there is no problem of intersection and little part of curves... at the 500% zoom


From: Ad (JUSTABLE)
30 Mar 2023   [#17] In reply to [#15]
Hi Michael,

>Pretty difficult to make that happen currently at least. To start with as you have noted there are often little pieces which are hard for a joiner to process automatically.<

Sorry I threw that at you. I haven't really thought through this, I just thought out loud. But after some more thinking, I realized this is probably a
no-go. And like you said, on top of that, some edges would have to be duplicated.

@Frenchy Pilou, the pdf export was actually the first thing I did, but if I have to clean up things, it is actually easier to do right there in Moi. At least for me.

Thanks to everybody for your input and suggestions, definately got me a step further.
From: pressure (PEER)
18 Apr 2023   [#18] In reply to [#17]
Hi Ad,

Have you tried out the latest v5 beta? It seems like hidden line removal is less sensitive to object size now.

- Peer
From: Ad (JUSTABLE)
20 Apr 2023   [#19] In reply to [#18]
Hi Peer,

I just used make2d with a different part, on the April 8 Beta.
The results were much better, but like I said this was a different
part.

After trying several different options, including other software,
I decided to stick with Moi. Just have to do some clean up, but
either way I have to prep things for my purpose anyway and doing
it in Moi is the most efficient way for me personally.

Ad