MoI discussion forum
MoI discussion forum

Full Version: Trim command behavior options

Show messages:  1-16  17-29

From: Michael Gibson
23 Jan 2023   [#17] In reply to [#10]
Hi Rick,

re:
> After swiping across the curve to trim away I get a 'beachball' for maybe 15 seconds and then
> every intersecting line on the entire model is 'broken' by inserting a point at the intersection- another
> 10 or 15 seconds and the section I wanted trimmed is gone.

This likely has more to do with your particular model than being on Mac, can you please send the file to me at moi@moi3d.com so I can test with it?

One problem that I just fixed now is that it was trying to process hidden curves instead of skipping them.

Also I've updated it so that it only tries to intersect curves that are on the same plane as the swipe, that should help with performance.

Thanks, - Michael
From: Frenchy Pilou (PILOU)
23 Jan 2023   [#18] In reply to [#16]
Cool!
But seems this is not the same behaviour of the Trimer...
Now it is like a Polyline and not a curve!
Does this normal ?


From: Michael Gibson
23 Jan 2023   [#19] In reply to [#18]
Hi Pilou,

re:
> Now it is like a Polyline and not a curve!
> Does this normal ?

Turn off grid snap in the bottom toolbar.

- Michael
From: Michael Gibson
23 Jan 2023   [#20] In reply to [#14]
@Rick - thanks for sending the file through e-mail.

So just so others see this as well the slowdown issue is trying to use QuickTrim directly on your model with 3296 curves.

That will do the equivalent of using the regular Trim command and selecting all 3296 curves as both the objects to be cut and also as the cutting objects.

To solve this you'll need to narrow down the number of candidates that QuickTrim will be trying to process.

You can do that either by hiding curves outside of a current active working area of say a few hundred curves or by selecting curves in a particular area. If you have some selected curves the cutting up processing will only happen on that selection.

Maybe someday I can work on this to make a large several thousand candidate pool work better but that won't be anytime soon. To use it effectively you will need to narrow it down to something like 2 or 3 hundred curves or ideally even less rather than several thousand all being active on the same operation.

Thanks, - Michael
From: Frenchy Pilou (PILOU)
23 Jan 2023   [#21] In reply to [#19]
Ok!

And the Trimer works only on curves and not on Lines ?
From: Michael Gibson
23 Jan 2023   [#22] In reply to [#21]
Hi Pilou,

re:
> And the Trimer works only on curves and not on Lines ?

It works on lInes, but only if the line is being cut up into some pieces. It currently won't remove a line where the line only touches other things at its endpoints instead of being cut somewhere inside the line.

It will be able to do that in the next v5 beta release, it needs an adjustment in the Trim command factory to also target those cases.

- Michael
From: Frenchy Pilou (PILOU)
23 Jan 2023   [#23] In reply to [#22]
Thx for the Infos!
From: Marc (TELLIER)
20 Feb 2023   [#24]
Nice feature !

It could be interesting this kind of "draw to select" feature could apply on the regular selection behavior.
Perhaps with a modifier key ?

Marc
From: Rick
19 May 2023   [#25]
I'm happy to report that my initial post wasn't the result of hallucination- there is a way to streamline trimming but it uses the EXTEND command instead of TRIM- sounds kooky, but it works. Click on a line you want to trim on the side you want to keep, call the EXTEND command and click on the line you want to trim to and the excess line is gone- click away to clear the selection and trim again- the EXTEND command remains active. This is the behavior I originally asked about but couldn't recreate since I was using the wrong command. This method sometimes fails if the line to trim to offers a possibility to actually extend, but most of the time I'm trimming to a line that doesn't have an EXTEND option- can't explain why it trims correctly to a line through a circle, but I don't know what's going on in the code. After trimming this way for while it becomes really efficient- I make 2D drawings using MAKE2D and often have hundreds of lines the run on too far and trimming with EXTEND makes cleaning up a drawing much faster- for me at least.
Rick

Attachments:
MOI extend trim.pdf


From: Frenchy Pilou (PILOU)
20 May 2023   [#26]
Tricky!
From: pressure (PEER)
20 May 2023   [#27] In reply to [#25]
Hi Rick,

That's some interesting undocumented functionality you discovered! It also looks like both curves can be trimmed in one go with "mutual extend" by selecting both curves, calling Extend, and clicking Done.

Re:
> the EXTEND command remains active

Do you mean that you're tapping Enter on the keyboard to repeat the Extend command? I don't see the Extend command remaining active, but I can repeat it by tapping Enter like for all other commands.

I went back and read your posts from a few months ago and am thinking there might be a better way though...

Re:
> I wish I could capture the model at the point where all of the
> intersecting lines are broken into separate segments and just run
> around the model deleting all of the segments I want to trim, but I
> can't do anything once the beachball and point insertion process
> starts. It's so close to amazing- if I could forget about swiping and
> get MOI to temporarily insert a point that breaks every line at an
> intersection I could delete the offending line segments in no time.

You can do exactly that already with Trim by doing a "mutual trim" where you select everything, run Trim, and then click Done.

http://moi3d.com/4.0/docs/moi_command_reference4.htm#trim



But, like you ran into with the QuickTrim plugin, there might be some spinning beach ball for a little while. I just tried doing mutual trim on a drawing with 4700 curves and that took about 23 seconds to insert the temporary break points. But, doing 1200 of those curves only took 2 seconds.

Since mutual trimming bogs down with large numbers of curves it's probably a good idea to work on one section of a drawing at a time like Michael suggested. An easy way to do that is by selecting all the curves that cross an area using a right-to-left area selection box and then run Trim. Fragments to remove can be selected in groups with left-to-right area selection.

Re:
> Calling a Trim command and having it trim a selected line to
> intersections without clicking the cutting line and the segment to be
> deleted would be ideal, maybe with the option to delete or keep the new
> segment.

A plugin could be made along these lines, but what would the advantage be vs mutual trim? It could get around the performance issues when there are thousands of curves, but working on one area of a drawing at a time also does that.

Re:
> often have hundreds of lines the run on too far

Are you talking about problems with hidden line generation where a line that's visible but that disappears behind a solid object doesn't end exactly where it should? Are you running V5 beta Apr-13-2023? Michael made some pretty significant improvements to hidden line generation in the recent betas. Still not perfect especially on threads, but might save you quite a bit of work if you're not already using it.

Also, turning up the Resolution of make2d might help minimize the length of the line overshoots. The default is 25, but cranking it up to like 200 will make the overshoots a little shorter. Resolution of 200 requires having about 10 GB of RAM available.

- Peer

Image Attachments:
Rick_trim.gif 


From: Rick
21 May 2023   [#28] In reply to [#27]
Peer,
I can't thank you enough for pointing out what was right in front of me all along- the TRIM/MUTUAL option is exactly what I wanted- breaking a group of lines at every intersection. I regenerated some MAKE2D files, and cleaning them up is much easier- thanks again.
Rick
From: Matadem
28 May 2023   [#29]
This quicktrim script just saved me allot of time. :D

Show messages:  1-16  17-29