ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Context NTG <contextntg@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: MetaPost Question
Date: Mon, 7 Dec 2015 16:58:29 +0100	[thread overview]
Message-ID: <CAPtmdbP6M3T=6jh=VWge_OTF1-mO6O9aZ+qObp8cs7JhYcxXYQ@mail.gmail.com> (raw)
In-Reply-To: <CAPtmdbMZ_+668+M3UaJr55kVNO-tTryJpBLaFvUZStPA-R_jvg@mail.gmail.com>


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

I guess the code I am looking for is the below to hatch the cut-out
section. How can I load the MetaPost hatching package in Context minimals
so it understands the hatchfill command?

Thanks
Jeroen

\startMPinclusions

input hatching;

\stopMPinclusions


\starttext


\placefigure[here,force][fig:tubing]{Tubular Linear Volumetric Capacity}

{\startMPcode


% inner circle

draw fullcircle xscaled 2.5cm yscaled 0.7cm shifted (1.25cm,0);

draw (0,0) -- (0,-5cm) dashed evenly;

draw (2.5cm,0) -- (2.5cm,-5cm) dashed evenly;

draw fullcircle xscaled 2.5cm yscaled 0.7cm shifted (1.25cm,-5cm) dashed
evenly;


%outer circle

draw fullcircle xscaled 2.9cm yscaled 1cm shifted (1.25cm,0);

draw (-.2cm,0) -- (-.2cm,-5cm);

draw (2.7cm,0) -- (2.7cm,-5cm);

draw halfcircle scaled 2.9cm yscaled 0.012cm shifted (1.25cm,-5cm) dashed
evenly;

draw halfcircle scaled 2.9cm yscaled 0.012cm rotated 180 shifted
(1.25cm,-5cm);


%cut-out section

hatchfill circle withcolor (45, 5mm, -.5bp);

fill fullcircle xscaled 2.5cm yscaled 0.7cm shifted (1.25cm,-2.7cm)
withcolor (.6,.6,.6);

label.top("tubular",(1.26cm,-1.3cm));

label.top("inside area",(1.28cm,-1.8cm));

label.top("($in^2$)",(1.28cm,-2.4cm));


%arrows and label ID

drawarrow (0,-4.1cm) -- (2.5cm,-4.1cm);

drawarrow (2.5cm,-4.1cm) -- (0,-4.1cm);

label.top("ID ($in$)",(1.26cm,-4.15cm));


%arrows and label tubular length

draw (3.25cm,-5cm) -- (3.25cm,0);

drawarrow (3.25cm,-5) -- (3.25cm,0);

drawarrow (3.25cm,0) -- (3.25cm,-5cm);

label.top("tubular length ($in$)",(5.2cm,-2.75cm));


\stopMPcode}


\stoptext

2015-12-06 21:54 GMT+01:00 Context NTG <contextntg@gmail.com>:

> I am trying to graph a cylinder. Is there a way to draw a more elliptic
> top/bottom. This one seems some flattened at the top and bottom. I would
> like to hatch the mid elliptic that is collored grey now. Is there a way to
> do this.
>
> Thanks
> Jeroen
>
>
>
> \placefigure
>
> [here,force]
>
> [fig:tubing]
>
> {Tubular Linear Volumetric Capacity}
>
> {\startMPcode
>
>
> draw (0,0){up} ... (1.25cm, 2mm) ... (2.5cm,0){down} ... (1.25cm, -2mm)
> ... cycle;
>
> draw (0,0) -- (0,-5cm) dashed evenly;
>
> draw (2.5cm,0) -- (2.5cm,-5cm) dashed evenly;
>
> draw (0,-5cm){up} ... (1.25cm, -4.8cm) ... (2.5cm,-5cm){down} ... (1.25cm,
> -5.2cm) ... cycle dashed evenly;
>
>
> draw (-.2cm,0){up} ... (1.25cm, 3.5mm) ... (2.7cm,0){down} ... (1.25cm,
> -3.5mm) ... cycle;
>
> draw (-.2cm,0) -- (-.2cm,-5cm);
>
> draw (2.7cm,0) -- (2.7cm,-5cm);
>
> draw (-.2cm,-5cm){up} ... (1.25cm, -4.7cm) ... (2.7cm,-5cm){down} dashed
> evenly;
>
> draw (-.2cm,-5cm){down} ... (1.25cm, -5.3cm) ... (2.7cm,-5cm){up};
>
>
> fill (0,-2.5cm){up} ... (1.25cm, -2.3cm) ... (2.5cm,-2.5cm){down} ...
> (1.25cm, -2.7cm) ... cycle withcolor (.6,.6,.6) dashed evenly;
>
> label.top("tubular",(1.26cm,-1.1cm));
>
> label.top("inside area",(1.28cm,-1.6cm));
>
> label.top("($in^2$)",(1.28cm,-2.2cm));
>
>
> draw (3.25cm,-5cm) -- (3.25cm,0);
>
> drawarrow (3.25cm,-5) -- (3.25cm,0);
>
> drawarrow (3.25cm,0) -- (3.25cm,-5cm);
>
> label.top("tubular length ($in$)",(5.2cm,-2.75cm));
>
>
> \stopMPcode}
>

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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2015-12-07 15:58 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 20:54 Context NTG
2015-12-06 21:49 ` Alan BRASLAU
2015-12-07 15:58 ` Context NTG [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-12-01 22:25 metapost question Hans van der Meer
2011-12-01 23:30 ` Peter Rolf
2011-10-21 13:05 Hans van der Meer
2011-10-21 15:13 ` Peter Rolf
2011-10-21 15:34   ` Meer, H. van der
2011-10-21 18:13   ` Meer, H. van der
2011-10-21 18:02 ` Nicola
2009-05-11 15:14 Metapost question Jean Magnan de Bornier
2009-05-11 15:34 ` Peter Rolf
2009-05-11 16:27   ` Jean Magnan de Bornier
2009-05-11 15:42 ` Mojca Miklavec
2009-05-11 15:58   ` Mojca Miklavec
2009-05-11 16:31     ` Jean Magnan de Bornier
2009-05-11 16:52       ` Mojca Miklavec
2009-05-11 17:33         ` Jean Magnan de Bornier
2009-05-11 18:02           ` Mojca Miklavec
2009-05-12  4:33             ` Jean Magnan de Bornier
2009-05-12  7:42               ` Taco Hoekwater
2009-05-12 14:15                 ` Jean Magnan de Bornier
2009-05-12 14:32                   ` Aditya Mahajan
2009-05-12 15:11                     ` Jean Magnan de Bornier
2009-05-12 15:53                       ` Taco Hoekwater
2009-05-12 16:37                         ` Jean Magnan de Bornier
2009-05-13  6:45                           ` Taco Hoekwater
2009-05-13  8:19                             ` Jean Magnan de Bornier
2009-05-11 18:16           ` Jean Magnan de Bornier
2009-05-11 17:01   ` Hans Hagen
2009-05-11 18:08     ` Mojca Miklavec
2009-05-11 15:47 ` Aditya Mahajan
2008-06-18 11:14 metapost question Thomas A. Schmitz
2008-06-18 11:43 ` Wolfgang Schuster
2008-06-18 11:58 ` Peter Rolf
2008-06-18 12:11   ` Thomas A. Schmitz
2007-10-08 13:47 Thomas A. Schmitz
2007-10-08 16:49 ` Otared Kavian
2007-10-08 17:34   ` Thomas A. Schmitz
2007-10-08 18:10   ` Jesse Alama
2007-10-23 12:17     ` Thomas A. Schmitz
2007-10-23 12:26       ` Hans Hagen
2007-10-23 20:58         ` Thomas A. Schmitz
2007-06-28 17:27 MetaPost question Tobias Burnus
2007-06-28 17:48 ` Taco Hoekwater
2007-05-02 20:38 Tobias Burnus
2007-05-02 20:46 ` Aditya Mahajan
2007-05-04 21:18   ` Aditya Mahajan
2005-06-14  6:54 Metapost question Tobias Burnus
2005-06-14  7:42 ` Taco Hoekwater
2005-06-14 10:51   ` h h extern
2005-06-14  7:56 ` Albrecht Kauffmann
2001-11-17 19:54 MetaPost question Jose Luis Diaz
2001-11-18  6:18 ` Johannes H?sing
2001-11-18 11:57 ` Denis B. Roegel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPtmdbP6M3T=6jh=VWge_OTF1-mO6O9aZ+qObp8cs7JhYcxXYQ@mail.gmail.com' \
    --to=contextntg@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).