MoI discussion forum
MoI discussion forum

Full Version: looking for a script to create multiple offset lines

Show messages:  0-19  20-26

From: nemoz
2 Nov   [#1]
I would likt ot know if there is a script to create a set of offset lines with fixed distance between them... for example 2mm between them.

thanking you in advance

S
From: Michael Gibson
2 Nov   [#2] In reply to [#1]
Hi nemoz,

> I would likt ot know if there is a script to create a set of offset lines
> with fixed distance between them... for example 2mm between them.

Not that I know of, so I wrote the attached one for you.

- Michael

Attachments:
OffsetMulti.js


From: Frenchy Pilou (PILOU)
2 Nov   [#3] In reply to [#1]
Why not use the native Transform Array Dir
Pick the base point and then pick the Offset Point...
You can see or enter any dimension in the "d box"


From: Michael Gibson
2 Nov   [#4] In reply to [#3]
Hi Pilou, array and offset generate different geometry. They are only equivalent for some special cases like a line.

Here's an example:



- Michael

Image Attachments:
PilouOffsetVsArray.png 


From: Frenchy Pilou (PILOU)
2 Nov   [#5] In reply to [#4]
Ah yes... :)
From: Frenchy Pilou (PILOU)
2 Nov   [#6]
So maybe CMorph is a little more appropriated ?

here start and target are not same size, but we can take same size...


From: Michael Gibson
2 Nov   [#7] In reply to [#6]
Hi Pilou,

re:
> So maybe CMorph is a little more appropriated ?

It could be somewhat closer in some cases but still different from what offset does.

Here's another example of offset:




- Michael

Image Attachments:
PilouOffsetVsArray2.png  PilouOffsetVsArray3.png 


From: Frenchy Pilou (PILOU)
2 Nov   [#8]
Ok Offset makes deformations!
From: blowlamp
3 Nov   [#9]
How do you set the number of offsets and their distance apart, etc?

Martin.
From: Frenchy Pilou (PILOU)
3 Nov   [#10] In reply to [#9]
For the moment i believe you must edit the file! and change values 2 & 4 ;)
2 var num_offsets = 4;
3 var offset_distance = 2;

Or use the Elephant Node Editor! But it's an another story! :)
https://moiscript.weebly.com/biblio-elephant.html
From: Frenchy Pilou (PILOU)
3 Nov   [#11]
But I have refound this! Maybe Michael don't remember of that! ;) 2012 ;)

https://moiscript.weebly.com/offsetmultistep.html





New French Version done! ;)


From: Frenchy Pilou (PILOU)
3 Nov   [#12]
Seems curves can be 3D but some fail to calculate!
Here a simple Helix







From: Michael Gibson
3 Nov   [#13] In reply to [#11]
Hi Pilou,

re:
> But I have refound this! Maybe Michael don't remember of that! ;) 2012 ;)

Oops, I did forget that one, thanks Pilou!

English version here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=4898.19

- Michael
From: BurrMan
3 Nov   [#14] In reply to [#13]
Hi Michael,
There is a limitation written into this command. Can you see if it can be removed?

OffSetMultiStep

https://moi3d.com/forum/index.php?webtag=MOI&msg=4898.19

(Inches) With a distance of 1 anything over 12 steps starts to do a skip, space miscalc

If the distance is .25, then the steps have to be 48 or more

Anyway, let me know if this doesn't happen for you....
From: Michael Gibson
3 Nov   [#15] In reply to [#14]
Hi Burr,

re:
> (Inches) With a distance of 1 anything over 12 steps starts to do a skip, space miscalc

Hmm, I'm not seeing it over here:



Can you please post an example file?

- Michael

Image Attachments:
burr_offset_multi.png 


From: BurrMan
4 Nov   [#16] In reply to [#15]
Hi Michael,
Saw your post and created a new file and curve and it seemed to produce a proper result.

Changed the perameters like distance and a large count and then it stopped updating the count. If i put 50 it only created 11

closed and logged off and reopened moi and did it again and got the space...

Can you try a few different params with a larger count and verify it is only me?

Thank you..

Attachments:
offset odd.zip


From: BurrMan
4 Nov   [#17] In reply to [#16]
here is running it twice with 24 count




The first time it created the 1 block with only 7 objects. the last one spaced. Selected the spaced last object and got 3 sets of 7, spaced

Image Attachments:
offset anom.jpg 


From: BurrMan
4 Nov   [#18] In reply to [#17]
I am starting to think it is my test curves particular shape and not being able to offset that many times due to its back and forth wiggle...

Did some testing with a trimmed circle and offset to the outside and it would do 50 count fine

did a retest with a dramatically wavy curve and the count went down to only 2 objects created no matter how many was chosen.

I think it may be a "You cant offset that curve that many times without folding back on itself" issue...
From: Michael Gibson
4 Nov   [#19] In reply to [#18]
Hi Burr, does it generate the missing ones if you turn off the "Trim" checkbox?



It looks like offset is having difficulty detecting the self-intersecting spot on this particular shape. If this happens you can turn off Trim and then get some pieces to work with.

- Michael

Image Attachments:
offset_trim.png 


From: BurrMan
4 Nov   [#20] In reply to [#19]
That was it! And I didn't manage to use my dedouchary skills to equate the "trim" to getting the "compute anyway" result...

Just what I needed. Thanks for the help. Sorry to bother....

Show messages:  0-19  20-26