Paramètres

Choose language

Updates on code 38 posts, 3 écrivains, 29 lecteurs, débuté il y a 88 mois

posté il y a 67 mois (Sunday, March 3) par jne4sl
#26
Would it be possible for the function 'Mirror' to work with any path as the reflection, not just a line?  It would then just mirror about the vector defined by path.a1.  This would be analogous to the way 'Magnet' works, something I find very useful.  I frequently find this is what I want to do, and right now I have to create a temporary point to accomplish it e.g. if I had a path 'waist' and a path 'hip'

h2 = apply(hip.p1, 1.0, hip.a1)
mirror((waist), [hip.p1:p2])

when
mirror((waist), hip)

would be simple and seems like a reasonable extension of the existing function.  I guess maybe not everyone would have the same notion of how reflection about path should be defined, as this doesn't preserve distances to the path.  Still when working with paths, this is something I find myself needing to do.  Especially when half-front and half-back of a garment are drafted on the same side of the body instead of mirrored.
Ce post a des réponses: ( #27 )

Ce post est réponse à #26
posté il y a 67 mois (Monday, March 4), édité il y a 67 mois par Sewist
#27
Well, on the one hand this is an easy add-on, on the other hand it makes sense when a path is more or less straight.

If a path is curved, visually and psychologically the mirror effect will make little sense, I am afraid, as the reference (line as of now) should represent the fold line.

If, for example, you mirror back against a path that is straight but consists of two lines (e.g. center_back=path(upper_center_back, lower_center_back) where the two latter are lines), and mirroring against center_back returns an error, then you can simply mirror against upper_back. No need to use the whole 'fold line', you just need to define the vector, and a shorter line is enough for this.
Ce post a des réponses: ( #28 )

Ce post est réponse à #27
posté il y a 67 mois (Monday, March 4), édité il y a 67 mois par jne4sl
#28
Yes, I know it is in no sense mirroring across the path.  It's just in practice one thing mirror is used for is to check what's going on in the vicinity of the end of the path (because that's where another seam line crosses).  It's the same with magnet.  When you magnet two straight shoulder seams together it's very clear why the name is correct.  But if one of the paths takes a sharp turn a couple milimeters from it's start, magnet may have limited use.

But those are the sort of consideration the user already has to contend with--is the hip shape too severe to be useable?  In practice the most frequent way I'm using these functions is to compare intersecting seams at the endpoints of paths.  If I've drafted a shirt with the front and back concentric, I may want to check how my armholes match up even though my side seams aren't perfectly straight, or even piecewise straight.  I can use magnet to bring the two underarm points into alignment with respect to the side seam (and don't have to draw a temporary guide point to do it), but then I have to also reflect the back armhole with respect to the side seam at the underarm point, so that I can see the back armhole as a continuation of the front.  I then might make an adjustment to some or all of the four paths.  Then I undo the mirror and I undo the magnet (with respect to the original paths).  Then dispose of the old paths.  

I know how to do this without the added functionality to mirror, but it would make my thinking a little more consistent if mirror could handle an arbitrary path, too.  It also could be a somewhat silent functionality, that extends mirror but isn't emphasized in the manual.

E.g.

magnet((lower_armhole_back), side_seam_back, side_seam_front)
mirror((lower_armhole_back), side_seam_front){
draw a new armhole between the armhole fragments
cut the new underarm according to the front seam and draw a new front side seam
} mirror((new_lower_armhole_back), side_seam_front)
magnet((new_lower_armhole_back), side_seam_front, side_seam_back)
draw new side_seam_back
dispose of the old side seams

The other way I could do the same, is to mirror the back pieces about any line, say center front, and then apply magnet.  This works because, it's never necessary to have an arbitrary mirror, all reflections can be generated by reflection about a single (non-degenerate) line followed by a rotation (which is what magnet provides).  But just like providing a mirror function that works for arbitrary lines simplifies the geometry for someone who doesn't know how reflections and rotations interact, allowing mirror about a path might simplify geometry for someone who isn't comfortable with drawing directional vectors. 




Ce post a des réponses: ( #29 )

Ce post est réponse à #28
posté il y a 67 mois (Tuesday, March 5) par Sewist
#29
 I see.. well, let us add it and be it a silent feature for now, and we will then see if it becomes handy. :) I'll post a ticket to the IT.
Ce post a des réponses: ( #30 )

Ce post est réponse à #29
posté il y a 67 mois (Wednesday, March 6) par jne4sl
#30
Thanks, that works for me, hopefully others will find it useful.
Ce post a des réponses: ( #31 #32 )

Ce post est réponse à #30
posté il y a 67 mois (Friday, March 8) par Sewist
#31
Just wanted to say we will finish it next week, as the IT member who is fixing this is on a sick leave till then :)

Ce post est réponse à #30
posté il y a 66 mois (Thursday, March 14) par Sewist
#32
Hi, it has been done and will be released today :)
Ce post a des réponses: ( #33 #34 )

Ce post est réponse à #32
posté il y a 66 mois (Thursday, March 14) par jne4sl
#33
Thanks!

Ce post est réponse à #32
posté il y a 66 mois (Friday, March 15) par jne4sl
#34
Ok, don't hate me, but it's not working the way I would like, and it's probably because I wasn't clear.  What I would like is for mirror to act on a path in a way analogous to magnet, i.e. based on the initial behavior of the path, not both endpoints.

The new function mirrors about a path by using the both endpoints
so,

mirror((something),path)

is just the old mirror function:

mirror((something),[path.p1:path.p2])

I don't really need that extension, because it's already possible to write with one line of code in an intuitive way.

What I want, is for mirror path to be a 'mirror' about the initial vector of the path.  Which right now, I would do like this, first constructing a temporary point p_:

p_ = apply(path.p1, 1.0, path.a1)
mirror((something),[path.p1:p_])

Which I don't like because it forces me to create a temporary line to mirror about when all the information is already encoded in the path.

I would also like to be able to mirror about the negative of a path, so that:

mirror((something),-path)

would be:

p_ = apply(path.p2, 1.0, path.a2)
mirror((something),[path.p2:p_])

If it's any help, here's a code fragment that suppresses length on a curve by adding a contour dart:


Lines 38 and 42 are 'magnet' being used with a path and a negative path, in an intuitive way, to close a dart.

Lines 51 and 59 are how I would like to use 'mirror' when truing the top edge of the dart.

Lines 52, 53 and 60, 61 are what I've done instead.

Anyway, that's my request.  I can use the existing mirror function to do what I want to do, so it's not essential to me.  I just find the way 'magnet' works to be extremely convenient, and constructing line segments to work with 'mirror' a little annoying.  And I thought it might be an intuitive construction for anyone who doesn't think to create a line segment.

Thanks, again!




Ce post a des réponses: ( #35 )

Ce post est réponse à #34
posté il y a 66 mois (Tuesday, March 19) par Sewist
#35
Fixed, could you please check and see if we got it right this time? :)
Ce post a des réponses: ( #36 )

Ce post est réponse à #35
posté il y a 66 mois (Tuesday, March 19) par jne4sl
#36
Mirror now works perfectly for a path!

I'd also like to be able to mirror about a negative path, meaning reflect about the direction of the end of the path, e.g. if c0 is a path

mirror((obj), -c0)

would be the same as this:

_c0 = path(-c0)
mirror((obj), _c0)

or, with respect to mirror acting on a line,

temp = apply(c0.p2, 1.0, c0.a2)
mirror((obj), [c0.p2:temp]

The function 'magnet' allows a negative sign to reverse the path and it's very useful.

Ce post a des réponses: ( #37 )

Ce post est réponse à #36
posté il y a 66 mois (Wednesday, March 20) par Sewist
#37
I told the IT that this is something that would be great, and they said they'd have a look occasionally, the function may need to be rewritten a bit and there will be many tests required. But they do remember :)
Ce post a des réponses: ( #38 )

Ce post est réponse à #37
posté il y a 66 mois (Wednesday, March 20) par jne4sl
#38
Cool, thanks!