ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* A Metafun-Problem
@ 2021-04-12 21:06 Willi Egger
  2021-04-12 21:22 ` Jairo A. del Rio
  0 siblings, 1 reply; 5+ messages in thread
From: Willi Egger @ 2021-04-12 21:06 UTC (permalink / raw)
  To: NTG-Context ConTeXt users


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

Hi

can somebody tell me why I do not get a trapezoid with bottom angles of 120 degrees?

Please try the attached minimal example.

Thank you!

Willi

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

[-- Attachment #1.2.2: test.tex --]
[-- Type: application/octet-stream, Size: 833 bytes --]

% Context file
% Filename: test.tex
% Willi Egger
% 12-04-2021

\startuniqueMPgraphic{Hive}
	numeric b,d,u ;
	path p[], line[] ;
	pair Pkt[],destination[];

	u :=  0.1 mm ;	
	b :=  360u ;
	d :=  260u ;

	
	p[1] := unitsquare xscaled b yscaled d ;

	destination[1] := dir(-60) * 200u ;
	destination[2] := dir(-120) * 200u	;
	
	line[1] := llcorner p[1]--lrcorner p[1];

	line[2] := ulcorner p[1] -- destination[1] ;
	line[3] := urcorner p[1] -- destination[2] ;

	Pkt[1] := line[2] intersectionpoint line[1] ;
	Pkt[2] := line[3] intersectionpoint line[1] ;
	
	draw p[1] ;
	
	draw ulcorner p[1] -- Pkt[1] ;
	draw urcorner p[1] -- Pkt[2] ;
	draw destination[1] withpen pencircle scaled 3pt withcolor red;
	draw destination[2] withpen pencircle scaled 3pt withcolor green;
\stopuniqueMPgraphic

\starttext

	\useMPgraphic{Hive}

\stoptext

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

[-- Attachment #1.2.4: test.pdf --]
[-- Type: application/pdf, Size: 4299 bytes --]

[-- Attachment #1.2.5: Type: text/html, Size: 217 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: A Metafun-Problem
  2021-04-12 21:06 A Metafun-Problem Willi Egger
@ 2021-04-12 21:22 ` Jairo A. del Rio
  2021-04-12 21:39   ` Willi Egger
  2021-04-12 21:47   ` Willi Egger
  0 siblings, 2 replies; 5+ messages in thread
From: Jairo A. del Rio @ 2021-04-12 21:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Is this what you need? If so, change unitsquare by fullsquare.

Jairo

El lun, 12 de abr. de 2021 a la(s) 16:06, Willi Egger (context@boede.nl)
escribió:

> Hi
>
> can somebody tell me why I do not get a trapezoid with bottom angles of
> 120 degrees?
>
> Please try the attached minimal example.
>
> Thank you!
>
> 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: 1793 bytes --]

[-- Attachment #2: test.pdf --]
[-- Type: application/pdf, Size: 4293 bytes --]

[-- Attachment #3: 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: A Metafun-Problem
  2021-04-12 21:22 ` Jairo A. del Rio
@ 2021-04-12 21:39   ` Willi Egger
  2021-04-12 21:47   ` Willi Egger
  1 sibling, 0 replies; 5+ messages in thread
From: Willi Egger @ 2021-04-12 21:39 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

Thank you Jairo for your immediate answer. Although it is not yet what I have in mind, I see now what to do.

Thanks!

Willi

> On 12 Apr 2021, at 23:22, Jairo A. del Rio <jairoadelrio6@gmail.com> wrote:
> 
> Is this what you need? If so, change unitsquare by fullsquare.
> 
> Jairo
> 
> El lun, 12 de abr. de 2021 a la(s) 16:06, Willi Egger (context@boede.nl) escribió:
> Hi
> 
> can somebody tell me why I do not get a trapezoid with bottom angles of 120 degrees?
> 
> Please try the attached minimal example.
> 
> Thank you!
> 
> 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
> ___________________________________________________________________________________
> <test.pdf>___________________________________________________________________________________
> 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: A Metafun-Problem
  2021-04-12 21:22 ` Jairo A. del Rio
  2021-04-12 21:39   ` Willi Egger
@ 2021-04-12 21:47   ` Willi Egger
  2021-04-13  6:18     ` Hans Hagen
  1 sibling, 1 reply; 5+ messages in thread
From: Willi Egger @ 2021-04-12 21:47 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

Hi,

Ok, changing the unitsquare into fullsquare is giving a better result, however it is still not the right drawing. I realise, that in this case probably the use of a vector in this way is not appropriate. — I have changed the drawing into something with rotating the top-line of the rectangle around the corner. If I am correct, then this is the right drawing.

Thank you again for your answer, it made me see the culprit correctly!

Kind regards

Willi

[-- Attachment #2: test.tex --]
[-- Type: application/octet-stream, Size: 1150 bytes --]

% Context file
% Filename: test.tex
% Willi Egger
% 12-04-2021

\startuniqueMPgraphic{Hive}
	numeric b,d,u ;
	path p[], line[] ;
	pair Pkt[],destination[];

	u :=  0.1 mm ;	
	b :=  360u ;
	d :=  260u ;

	
	p[1] := fullsquare xscaled b yscaled d ;

	destination[1] := dir(-60) * 200u ;
	destination[2] := dir(-120) * 200u	;
	
	line[1] := llcorner p[1]--lrcorner p[1];

	line[2] := ulcorner p[1] -- destination[1] ;
	line[3] := urcorner p[1] -- destination[2] ;
	
	line[10] := (ulcorner p[1]--urcorner p[1]) rotatedaround(ulcorner p[1],-60) ;
	line[11] := (urcorner p[1]--ulcorner p[1]) rotatedaround(urcorner p[1],60) ;
	
	Pkt[1] := line[2] intersectionpoint line[1] ;
	Pkt[2] := line[3] intersectionpoint line[1] ;
	
	draw p[1] ;
	
	draw ulcorner p[1] -- Pkt[1] withcolor yellow;
	draw urcorner p[1] -- Pkt[2] withcolor yellow;
	draw destination[1] withpen pencircle scaled 3pt withcolor red;
	draw destination[2] withpen pencircle scaled 3pt withcolor green;
	
	draw  line[10] withcolor blue ;
	draw line[11] withcolor blue ;
	draw origin withpen pencircle scaled 3pt withcolor blue;
\stopuniqueMPgraphic

\starttext

	\useMPgraphic{Hive}

\stoptext

[-- Attachment #3: test.pdf --]
[-- Type: application/pdf, Size: 4337 bytes --]

[-- Attachment #4: Type: text/plain, Size: 1480 bytes --]



> On 12 Apr 2021, at 23:22, Jairo A. del Rio <jairoadelrio6@gmail.com> wrote:
> 
> Is this what you need? If so, change unitsquare by fullsquare.
> 
> Jairo
> 
> El lun, 12 de abr. de 2021 a la(s) 16:06, Willi Egger (context@boede.nl) escribió:
> Hi
> 
> can somebody tell me why I do not get a trapezoid with bottom angles of 120 degrees?
> 
> Please try the attached minimal example.
> 
> Thank you!
> 
> 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
> ___________________________________________________________________________________
> <test.pdf>___________________________________________________________________________________
> 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 #5: 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: A Metafun-Problem
  2021-04-12 21:47   ` Willi Egger
@ 2021-04-13  6:18     ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2021-04-13  6:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Willi Egger

On 4/12/2021 11:47 PM, Willi Egger wrote:
> Hi,
> 
> Ok, changing the unitsquare into fullsquare is giving a better result, however it is still not the right drawing. I realise, that in this case probably the use of a vector in this way is not appropriate. — I have changed the drawing into something with rotating the top-line of the rectangle around the corner. If I am correct, then this is the right drawing.
> 
> Thank you again for your answer, it made me see the culprit correctly!
I hav eno clu ewhat the intended outcome is but here's some code that 
shows how triangles relate to squares

\startMPpage
     path p ; p := fullsquare               scaled 4cm;
     path q ; q := fulltriangle rotated -90 sized  4cm;

     draw p withcolor red ;
     draw q withcolor green ;

     draw center p withpen pencircle scaled 3mm withcolor red ;
     draw center q withpen pencircle scaled 2mm withcolor green ;
     draw origin   withpen pencircle scaled 1mm withcolor white ;

     draw q shifted (center p - center q) withcolor blue ;
\stopMPpage


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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-04-13  6:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 21:06 A Metafun-Problem Willi Egger
2021-04-12 21:22 ` Jairo A. del Rio
2021-04-12 21:39   ` Willi Egger
2021-04-12 21:47   ` Willi Egger
2021-04-13  6:18     ` Hans Hagen

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).