ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Trouble constructing a drawer rail with MP
@ 2021-05-21 10:56 Willi Egger
  2021-05-21 11:15 ` Jairo A. del Rio
  0 siblings, 1 reply; 5+ messages in thread
From: Willi Egger @ 2021-05-21 10:56 UTC (permalink / raw)
  To: NTG-Context ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 398 bytes --]

Hello MP Gurus!

I wanted to make a technical drawing. However the enclosed mwe does not give me the required results.

While the vector from point 1 is directing in the desired direction of 194 degrees, the second vector from point 2 does not as defined point in the direction of 166 degrees.

What am I doing wrong here?


Thanks for pointing me into the right direction :-)

Willi


[-- Attachment #1.2.1: Type: text/html, Size: 732 bytes --]

[-- Attachment #1.2.2: test-rail.pdf --]
[-- Type: application/pdf, Size: 5237 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 235 bytes --]

[-- Attachment #1.2.4: test-rail.tex --]
[-- Type: application/octet-stream, Size: 850 bytes --]


\startuniqueMPgraphic{Rail}
	path p[];
	pair Pkt[];
	
	p[100] := unitsquare xscaled 15mm yscaled 50mm;
	p[101] := (lrcorner p[100]--urcorner p[100]) shifted (-5mm,0) ;
	
	Pkt[1] := point 1.2 of p[100];
	Pkt[2] := point 1.8 of p[100];
	
	p[102] := Pkt[1]--dir(194)*10mm;
	
	Pkt[3] := p[102] intersectionpoint p[101];
	
	p[103] := Pkt[2]--dir(166)*10mm;
	
	Pkt[4] := p[103] intersectionpoint p[101];
	
	p[104] := lrcorner p[100]--Pkt[1]--Pkt[3]--Pkt[4]--Pkt[2]--urcorner p[100];
	
	draw p[104];
	
	draw p[100];
	draw p[101] dashed withdots;

	for i = 1 upto 4 :
	 draw Pkt[i] withpen pencircle scaled 3pt withcolor red;
  endfor;
	
	label.lft(textext("Pkt 2"),Pkt[3]);
	label.lft(textext("Pkt 4"),Pkt[4]);
	label.rt(textext("Pkt 1"), Pkt[1]);
	label.rt(textext("Pkt 2"), Pkt[2]);
\stopuniqueMPgraphic

\startTEXpage

	\useMPgraphic{Rail}

\stopTEXpage

[-- Attachment #1.2.5: Type: text/html, Size: 243 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble constructing a drawer rail with MP
  2021-05-21 10:56 Trouble constructing a drawer rail with MP Willi Egger
@ 2021-05-21 11:15 ` Jairo A. del Rio
  2021-05-21 19:26   ` Willi Egger
  0 siblings, 1 reply; 5+ messages in thread
From: Jairo A. del Rio @ 2021-05-21 11:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1204 bytes --]

Hi!

Do

p[102] := (origin--dir(194)*10mm) shifted Pkt[1];

and

p[103] := (origin--dir(166)*10mm) shifted Pkt[2];

do what you need?

Jairo

El vie, 21 de may. de 2021 a la(s) 05:57, Willi Egger (context@boede.nl)
escribió:

> Hello MP Gurus!
>
> I wanted to make a technical drawing. However the enclosed mwe does not
> give me the required results.
>
> While the vector from point 1 is directing in the desired direction of 194
> degrees, the second vector from point 2 does not as defined point in the
> direction of 166 degrees.
>
> What am I doing wrong here?
>
>
> Thanks for pointing me into the right direction :-)
>
> Willi
>
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 2194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble constructing a drawer rail with MP
  2021-05-21 11:15 ` Jairo A. del Rio
@ 2021-05-21 19:26   ` Willi Egger
  2021-05-21 19:58     ` Mikael Sundqvist
  0 siblings, 1 reply; 5+ messages in thread
From: Willi Egger @ 2021-05-21 19:26 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

Hi Jairo!

thank you so much, this is precisely what I need.

Still I am wondering why this is not working starting at the Pkt[2] but working when starting from Pkt[1].

Kind regards

Willi

> On 21 May 2021, at 13:15, Jairo A. del Rio <jairoadelrio6@gmail.com> wrote:
> 
> Hi! 
> 
> Do
> 
> p[102] := (origin--dir(194)*10mm) shifted Pkt[1];
> 
> and
> 
> p[103] := (origin--dir(166)*10mm) shifted Pkt[2];
> 
> do what you need? 
> 
> Jairo
> 
> El vie, 21 de may. de 2021 a la(s) 05:57, Willi Egger (context@boede.nl) escribió:
> Hello MP Gurus!
> 
> I wanted to make a technical drawing. However the enclosed mwe does not give me the required results.
> 
> While the vector from point 1 is directing in the desired direction of 194 degrees, the second vector from point 2 does not as defined point in the direction of 166 degrees.
> 
> What am I doing wrong here?
> 
> 
> Thanks for pointing me into the right direction :-)
> 
> Willi
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble constructing a drawer rail with MP
  2021-05-21 19:26   ` Willi Egger
@ 2021-05-21 19:58     ` Mikael Sundqvist
  2021-05-22 20:49       ` Willi Egger
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Sundqvist @ 2021-05-21 19:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

It was in fact not really "working", but it just happened that it
looked more or less correct in one case, but not in the other.

For example: The path Pkt[1]--dir(194)*10mm for example is not given
by the two points Pkt[1] and "Pkt[1] shifted 10mm in direction 194
degrees", but Pkt[1] and the point which is 10mm from the origin,
rotated 194 degrees.

/Mikael

On Fri, May 21, 2021 at 9:27 PM Willi Egger <context@boede.nl> wrote:
>
> Hi Jairo!
>
> thank you so much, this is precisely what I need.
>
> Still I am wondering why this is not working starting at the Pkt[2] but working when starting from Pkt[1].
>
> Kind regards
>
> Willi
>
> > On 21 May 2021, at 13:15, Jairo A. del Rio <jairoadelrio6@gmail.com> wrote:
> >
> > Hi!
> >
> > Do
> >
> > p[102] := (origin--dir(194)*10mm) shifted Pkt[1];
> >
> > and
> >
> > p[103] := (origin--dir(166)*10mm) shifted Pkt[2];
> >
> > do what you need?
> >
> > Jairo
> >
> > El vie, 21 de may. de 2021 a la(s) 05:57, Willi Egger (context@boede.nl) escribió:
> > Hello MP Gurus!
> >
> > I wanted to make a technical drawing. However the enclosed mwe does not give me the required results.
> >
> > While the vector from point 1 is directing in the desired direction of 194 degrees, the second vector from point 2 does not as defined point in the direction of 166 degrees.
> >
> > What am I doing wrong here?
> >
> >
> > Thanks for pointing me into the right direction :-)
> >
> > Willi
> >
> >
> > ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an entry to the Wiki!
> >
> > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki     : http://contextgarden.net
> > ___________________________________________________________________________________
> > ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an entry to the Wiki!
> >
> > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki     : http://contextgarden.net
> > ___________________________________________________________________________________
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble constructing a drawer rail with MP
  2021-05-21 19:58     ` Mikael Sundqvist
@ 2021-05-22 20:49       ` Willi Egger
  0 siblings, 0 replies; 5+ messages in thread
From: Willi Egger @ 2021-05-22 20:49 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

Hello Mikael,

thank you very much for the explanation. Indeed I was assuming that giving the starting point of a path followed by a dir would result in a vector starting from that point. — My knowledge about vectors is unfortunately super restricted :-(

Thanks

Willli 

> On 21 May 2021, at 21:58, Mikael Sundqvist <mickep@gmail.com> wrote:
> 
> Hi,
> 
> It was in fact not really "working", but it just happened that it
> looked more or less correct in one case, but not in the other.
> 
> For example: The path Pkt[1]--dir(194)*10mm for example is not given
> by the two points Pkt[1] and "Pkt[1] shifted 10mm in direction 194
> degrees", but Pkt[1] and the point which is 10mm from the origin,
> rotated 194 degrees.
> 
> /Mikael
> 
> On Fri, May 21, 2021 at 9:27 PM Willi Egger <context@boede.nl> wrote:
>> 
>> Hi Jairo!
>> 
>> thank you so much, this is precisely what I need.
>> 
>> Still I am wondering why this is not working starting at the Pkt[2] but working when starting from Pkt[1].
>> 
>> Kind regards
>> 
>> Willi
>> 
>>> On 21 May 2021, at 13:15, Jairo A. del Rio <jairoadelrio6@gmail.com> wrote:
>>> 
>>> Hi!
>>> 
>>> Do
>>> 
>>> p[102] := (origin--dir(194)*10mm) shifted Pkt[1];
>>> 
>>> and
>>> 
>>> p[103] := (origin--dir(166)*10mm) shifted Pkt[2];
>>> 
>>> do what you need?
>>> 
>>> Jairo
>>> 
>>> El vie, 21 de may. de 2021 a la(s) 05:57, Willi Egger (context@boede.nl) escribió:
>>> Hello MP Gurus!
>>> 
>>> I wanted to make a technical drawing. However the enclosed mwe does not give me the required results.
>>> 
>>> While the vector from point 1 is directing in the desired direction of 194 degrees, the second vector from point 2 does not as defined point in the direction of 166 degrees.
>>> 
>>> What am I doing wrong here?
>>> 
>>> 
>>> Thanks for pointing me into the right direction :-)
>>> 
>>> Willi
>>> 
>>> 
>>> ___________________________________________________________________________________
>>> If your question is of interest to others as well, please add an entry to the Wiki!
>>> 
>>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> wiki     : http://contextgarden.net
>>> ___________________________________________________________________________________
>>> ___________________________________________________________________________________
>>> If your question is of interest to others as well, please add an entry to the Wiki!
>>> 
>>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> wiki     : http://contextgarden.net
>>> ___________________________________________________________________________________
>> 
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-22 20:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 10:56 Trouble constructing a drawer rail with MP Willi Egger
2021-05-21 11:15 ` Jairo A. del Rio
2021-05-21 19:26   ` Willi Egger
2021-05-21 19:58     ` Mikael Sundqvist
2021-05-22 20:49       ` Willi Egger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).