How to shrink or resize multiple lines

Next
 From:  Matadem
10882.1 
Good day.
I am working a on project that has about 60 individual straight lines with different lenghts.

Is there a way for example to automatically cut 5mm at the beginning and the end of each line?

Thank you!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
10882.2 In reply to 10882.1 
The two end points could each be moved 5mm closer to each other, or 5mm closer to the center of the line.
A javascript script could be written...
Alignment for direction of line?...
For a line shorter than 10 mm, how much should be deducted?

- Brian

After some trials:
Make a helper line that is 5mm long, parallel to the line(s) to be shortened.
The start point and end point of the helper line yield the base point and offset point of the Move command, if used in the proper order,
in relation to the start and end points of the line to be shortened.
So some testing of which end of the line is the start, and which end has the ending point would be needed.

Scripts already exist to mark the start and end points of a line, but a new point should not be created. The ShowPoints command
shows the actual start and end points of the line, which are the type of points to be moved by 5mm, in the proper direction.

The move command does not depend ("does not care") on whether a point is the start of a line, or the end of a line. Just the direction to be moved by the proper amount, will matter, in this situation.

EDITED: 19 Oct 2022 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10882.3 In reply to 10882.1 
Hi Matadem,

re:
> Is there a way for example to automatically cut 5mm at the beginning and the end of each line?

There isn't a built in way to do that but it can be done with a script. I've attached a script that will chop off 5 units from the start and end of all selected lines.

There are instructions on how to install a plug-in script here:
https://moi3d.com/faq#Q:_How_do_I_install_a_plug-in_script.3F

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10882.4 In reply to 10882.3 
Can we modify it for have any wished number of unities ?
It's only for lines, not also for curves ?

EDITED: 19 Oct 2022 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10882.5 In reply to 10882.4 
Hi Pilou,

re:
> Can we modify it for have any wished number of unities ?

Yes, the distance it uses can be changed on line number 4 of the ShrinkLines.js file:
code:
	var chop_amount = 5.0;

> It's only for lines, not also for curves ?

Correct, this particular script is only for processing lines.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10882.6 In reply to 10882.5 
Thx for the infos!
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10882.7 
Seems if the lines are 5 unities or less nothing is done for these lines!

Does this normal ?
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10882.8 In reply to 10882.7 
Hi Pilou,

re:
> Seems if the lines are 5 unities or less nothing is done for these lines!
>
> Does this normal ?

Well the request was to chop off 5 units off the ends of each line.

If you do that to a line that is 10 units or shorter in size then there would be nothing left.

So yes that's normal for this particular use case for those lines to not be processed.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10882.9 In reply to 10882.8 
OK all is clear now! :)

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Matadem
10882.10 
Great!

Thank you!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Elang
10882.11 
How about creating circles with 5 mm radius to the endpoints of each line, then use these circles to cut the lines? This should too works for arcs, no?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
10882.12 In reply to 10882.11 
<< 5 mm radius to the endpoints of each line, then use these circles to cut the lines? This should too works for arcs

Vclone by Max can help you for this!

Work for only one extremity of something selected: Lines , arcs; curves etc...
So apply one time then select all lines Press Tab and write Flip
re-apply Vclone so all extremities will have their "circles" ;) (not shown here)

EDITED: 4 Nov 2022 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
10882.13 In reply to 10882.11 
Hi Elang,

re:
> How about creating circles with 5 mm radius to the endpoints of each line, then
> use these circles to cut the lines? This should too works for arcs, no?

Well whether it works for arcs or not depends on what result you need.

If you need to cut 5mm of "arc length" (distance as traveled like an ant walking along the curved arc), then no that wouldn't work.

If you wanted a result that placed the new arc's endpoint at 5mm "point to point" distance instead of arc length distance then yes that would work.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All