ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* MP bounding box
@ 2014-03-12 13:38 Peter Rolf
  2014-03-12 16:05 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Rolf @ 2014-03-12 13:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

Hi,

I run into a problem with the bounding box calculation of a MP graphic.
Seems like very small values are represented in scientific notation and
MP can't handle those.

Example attached.

[..]
<to be read again>
e
<to be read again> e
 -
<argument> 6.103515625e-
             005
\setMPboundingbox #1#2#3#46-\global \MPllx #1
                                             \onebasepoint \global
\MPlly #2...
\startMPLIBtoPDF ...MPboundingbox {#1}{#2}{#3}{#4}
                                                  \setbox \MPbox \vbox
\bgro...
l.13 }

...
l.50 \useMPgraphic{path:ivy}

!  ==> Fatal error occurred, no output PDF file produced!
mtx-context     | fatal error: return code: 1
[fin]


Greetings,  Peter

[-- Attachment #2: test.mkiv --]
[-- Type: text/plain, Size: 2767 bytes --]

\startuseMPgraphic{path:ivy}
%drawoptions (withcolor (0.792157,0.831373,0.654902));
linecap := butt;
linejoin := mitered;

path p;
p:= (176.858994,1.214840)..controls (166.410004,16.378901) and (164.914001,36.269501)..(152.785004,50.542999)
	..controls (139.113007,74.707001) and (135.578003,102.433998)..(131.085999,129.313004)
	..controls (125.551003,147.983994) and (134.164001,171.214996)..(120.188004,186.914001)
	..controls (106.214996,204.207001) and (85.527298,188.098007)..(68.574203,192.397995)
	..controls (50.648399,197.593994) and (33.652302,206.375000)..(16.855499,214.477005)
	..controls (-2.886720,220.117004) and (-7.417970,244.410004)..(14.824200,250.953003)
	..controls (32.433601,258.414001) and (47.558601,274.097992)..(67.972702,271.871002)
	..controls (81.707001,271.468994) and (108.027000,276.070007)..(93.878899,294.792999)
	..controls (88.523399,309.914001) and (81.296898,327.058990)..(87.390602,343.101990)
	..controls (93.996101,355.484009) and (114.109001,346.003998)..(123.848000,339.429993)
	..controls (139.315994,329.394989) and (156.770004,320.003998)..(163.925995,301.812988)
	..controls (174.339996,292.378998) and (167.679993,267.875000)..(180.132996,264.121002)
	..controls (184.688004,279.511993) and (183.315994,298.941010)..(196.539001,311.601990)
	..controls (210.559006,328.757996) and (230.438004,338.562988)..(247.210999,352.546997)
	..controls (257.906006,358.035004) and (266.890991,373.410004)..(270.281006,353.472992)
	..controls (274.277008,332.484009) and (279.863007,308.898010)..(266.949005,289.789001)
	..controls (254.492004,275.625000) and (267.703003,259.843994)..(281.632996,253.897995)
	..controls (296.359009,246.020004) and (310.902008,235.281006)..(328.187988,231.324005)
	..controls (347.582001,224.386993) and (355.777008,203.496002)..(372.128998,192.190994)
	..controls (385.386993,185.054993) and (395.425995,157.820007)..(370.398010,163.953003)
	..controls (344.117004,166.574005) and (317.691010,164.313004)..(291.351990,166.102005)
	..controls (273.718994,160.414001) and (249.440994,182.781006)..(237.477005,164.309006)
	..controls (229.477005,147.417999) and (230.983994,128.108994)..(224.882996,110.519997)
	..controls (222.667999,92.656303) and (210.332001,79.105499)..(204.438004,62.742199)
	..controls (205.897995,43.285198) and (196.070007,26.058599)..(185.500000,10.480500)
	..controls (183.128998,8.304690) and (181.695007,-3.820310)%..(176.858994,1.214840)
%	--cycle;
..cycle;

    w:= xpart urcorner boundingbox p;
    f:= 50mm/w; % lower then 60mm raises error
    p:= p scaled f;

    fill p;

    passvariable("ivy",p);
    setbounds currentpicture to boundingbox(p);
\stopuseMPgraphic


\starttext
\useMPgraphic{path:ivy}
\stoptext

[-- Attachment #3: 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
___________________________________________________________________________________

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

end of thread, other threads:[~2014-03-12 18:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-12 13:38 MP bounding box Peter Rolf
2014-03-12 16:05 ` Hans Hagen
2014-03-12 16:25   ` Peter Rolf
2014-03-12 17:15     ` Hans Hagen
2014-03-12 18:16       ` Peter Rolf

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