Re: Importing (& streamlining) EPS
Alejandro, > Tonight, I test your handler and I'm getting > two list of points. But in the first list, > the X coordinate is the same for all the > numbers of the list! > > What I'm doing wrong? > > Maybe this part is the problem. It returns the > same number. > > -- INITIALIZES step value AND fixed x values > > put trunc(abs(item 1 of last line of variablezxc-item > 1 of first line of variablezxc)/Nsteps) into v > put "" into Vsteps > repeat with i=1 to Nsteps > put item 1 of first line of variablezxc+(i*v) into > item 1 of line i of Vsteps > end repeat > put item 1 of first line of variablezxc & cr before > Vsteps WHOOOPS !!! I didn't send the very last version... The part of the handler quoted above should be replaced with the following : put trunc(abs(item 1 of a-item 1 of d)/Nsteps) into v put 0 into n put "" into Vsteps repeat with i=1 to Nsteps put item 1 of a+(i*v) into item 1 of line i of Vsteps end repeat put a & cr before Vsteps I just tested it and it works. Sorry for the mistake, JB ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Importing (& streamlining) EPS
Alejandro, > Can you give us an example of this linear > interpolation? At the end of this message you'll find the Bezier handler I'm using. The linear interpolation works although it's still a bit crude and needs some more fine tuning. I haven't had a look yet at the other approach you mentioned in your last email, but if that new solution is "really" computationally intensive, I guess I'll stick with linear interpolation which isn't too slow after all... > > > By the way jbv, you made a demostration of openGL > in MetaCard. Are you going to keep working in > this demo? or Abandoned the idea? Well, it's a long story. About 6 months ago, I was planing to develop this openGL thing within a project for a client. It seemed like a good opportunity to make some "applied research" financed by a real life project. Unfortunately, the client abandonned the project and I found myself overflooded with other things to do and had to put the idea on a shelf for a while. Now I'm working on it at home in my spare time (using Code Warrior on a Mac), and of course things have been slowed down by several orders of magnitude. It's quite irritating because it opens a fantastic new world... Anyway, if anyone is willing to sponsor this research, please contact me off-list... Thanks, JB -- on bezier global variablezxc,a,b,c,d,Vsteps put a &cr& b &cr& c &cr& d put the first item of a into x1 -- red dot the first item of the loc of grc startpoint put the first item of d into x2 -- blue dot the first item of the loc of grc endpoint put the first item of b into xa -- green dot the first item of the loc of grc control1 put the first item of c into xb -- yellow dot the first item of the loc of grc control2 put the second item of a into y1 put the second item of d into y2 put the second item of b into ya put the second item of c into yb put 20 into Nsteps put 0 into v1 put(1/Nsteps)into j put "" into n put "" into nv Repeat with i = 1 TO Nsteps put i*j into v1 put v1 into line i of n put 1-v1 into v2 put v1*v1*v2 into v11 put v1*v2*v2 into v22 put(v2^3)into v3 put(v1^3)into v13 put (x1*v3+(3*xa*v22)+(3*xb*v11)+(x2*v13))into x put (y1*v3+(3*ya*v22)+(3*yb*v11)+(y2*v13))into y put x div 1,y div 1 & return after variablezxc end repeat -- REMOVES similar successive pairs of values repeat with i=(number of lines of variablezxc) down to 2 if line i of variablezxc is not "" then if line i of variablezxc = line i-1 of variablezxc then delete line i of variablezxc end if end if end repeat -- INITIALIZES step value AND fixed x values put trunc(abs(item 1 of last line of variablezxc-item 1 of first line of variablezxc)/Nsteps) into v put "" into Vsteps repeat with i=1 to Nsteps put item 1 of first line of variablezxc+(i*v) into item 1 of line i of Vsteps end repeat put item 1 of first line of variablezxc & cr before Vsteps -- COMPUTES linear interpolation on y values according to new x values repeat with j=1 to (number of lines of Vsteps)-1 repeat with i=1 to number of lines of variablezxc if item 1 of line i of Vsteps = item 1 of line j of variablezxc then put item 2 of line i of variablezxc into item 2 of line i of Vsteps next repeat else if (item 1 of line i of Vsteps > item 1 of line j of variablezxc) and (item 1 of line i of Vsteps < item 1 of line (j+1) of variablezxc) then put item 1 of line j of variablezxc into x1 put item 1 of line (j+1) of variablezxc into x2 put item 2 of line j of variablezxc into y1 put item 2 of line (j+1) of variablezxc into y2 put trunc(y1+((y2-y1)*((item 1 of line i of Vsteps-x1)/(x2-x1 into item 2 of line i of Vsteps end if end if end repeat end repeat put item 2 of last line of variablezxc into item 2 of last line of Vsteps put Vsteps & cr & cr & variablezxc end bezier ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Importing (& streamlining) EPS
Simplest Linear interpolation: f(x) = x1 + (abs(x2 - x1) / 2) (given x1 < x2) - the abs() is the absolute function (x>0) just in case you want to skip checking x1 but here is a web page that describes another approach which is more formal and probably more correct for other applications where time is involved for example... http://www.cs.brown.edu/stc/outrea/greenhouse/nursery/interpolation/formal.html -=- Xavier Bury TNS NT LAN Server ext 6465 Alejandro Tejada <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 06/06/03 03:03 Please respond to metacard To: [EMAIL PROTECTED] cc: ^ Subject: Importing (& streamlining) EPS on Thu Jun 5 04:26:00 2003 jbv wrote: > in the EPStoMetacard stack (I'm not sure >I'm using the last version though), and more >specifically in the bezier handler, is there a way >to modify the equations used to get x values (and >the corresponding y values) EQUALLY SPACED >on the x axis ? There are other formulas to calculate the bezier points. I'll check my files to see if I find them. >I know I could use the handler as it is and then >perform linear interpolation, but I'd like to >compute the values on 1 single pass... Can you give us an example of this linear interpolation? By the way jbv, you made a demostration of openGL in MetaCard. Are you going to keep working in this demo? or Abandoned the idea? Alejandro = Useful sites: http://www.sonsothunder.com/devres/metacard/tips/ and /revolution/tips/ http://lists.runrev.com/pipermail/metacard/ and /use-revolution/ http://wiki.macitworks.com/revdocs http://www.google.com/advanced_search?q=site:lists.runrev.com __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard Visit us at http://www.clearstream.com IMPORTANT MESSAGE Internet communications are not secure and therefore Clearstream International does not accept legal responsibility for the contents of this message. The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender specifically states them to be the views of Clearstream International or of any of its affiliates or subsidiaries. END OF DISCLAIMER
Re: Importing (& streamlining) EPS
BTW in the EPStoMetacard stack (I'm not sure I'm using the last version though), and more specifically in the bezier handler, is there a way to modify the equations used to get x values (and the corresponding y values) EQUALLY SPACED on the x axis ? Oviously, it has to do with the way v1 and v2 are incremented in the loop, but my maths are too limited to figure out how to do that... I know I could use the handler as it is and then perform linear interpolation, but I'd like to compute the values on 1 single pass... Thanks, JB ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Importing (& streamlining) EPS
on Mon Jun 2 23:52:00 2003 Karl Becker wrote: >I'm wondering if there's a way >to intelligently trim the number of points >each of these graphics occupies? In the epsImport stack there is an field named "bezier resolution". This field determines the number of straight line segments used to draw the curves in Adobe Illustrator files. Test with low numbers (16 to 32) and high (128 to 256) and take note of the effect on the appareance and the redraw of the graphics. I know about your Golf game. Are you making your Golf courses as vector drawings? >I have a feeling if I have fifty graphic >objects each with 300 points or so >that MetaCard will crawl when I try to move >a group containing all fifty. >Anyone have experience with this? I have not notice delays when the graphics are grouped. Anyway, it could be more interesting if you compare the scroll of big groups of graphics, with the scroll of big groups of images. Newer versions of Adobe Illustrator are scriptables with applescript in mac and another language in windows. You could export every graphic as an image with a series of commands. I still had to learn how to take full advantage of this extraordinary capability. Alejandro = Useful sites: http://www.sonsothunder.com/devres/metacard/tips/ and /revolution/tips/ http://lists.runrev.com/pipermail/metacard/ and /use-revolution/ http://wiki.macitworks.com/revdocs http://www.google.com/advanced_search?q=site:lists.runrev.com __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Importing (& streamlining) EPS
I may have to answer my own question this time. I found the EPS to MetaCard thing mentioned below on a Revolution downloads page: http://www.runrev.com/Revolution1/developercentral/ usercontributions.html I should maybe email Alejandro, but what I'm wondering if there's a way to intelligently trim the number of points each of these graphics occupies? I have a feeling if I have fifty graphic objects each with 300 points or so that MetaCard will crawl when I try to move a group containing all fifty. Anyone have experience with this? Looks like some very great tools on that page, too! Karl On Monday, June 2, 2003, at 07:22 PM, Karl Becker wrote: I think it would help me out, yes, but that link gives a 404 error. If someone wants to send me a copy of that stack off-list, I'd really appreciate it. Thanks, Karl On Monday, June 2, 2003, at 06:16 PM, Ken Ray wrote: Karl, Alejandro Tejada has some sample code for importing EPS as polygons: http://ffc.virtualave.net/EPStoMetaCard.zip http://ffc.virtualave.net/EPStoMetaCard.sit I don't know if it will help you in your case, but you might want to check it out. Otherwise you'll need to find some way to convert your EPS graphics to JPEG, PNG, etc. Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Karl Becker Sent: Monday, June 02, 2003 4:48 PM To: [EMAIL PROTECTED] Subject: Importing EPS Is there any way to import EPS files as actual graphic objects in MetaCard? I was under the impression this could be done, as I always saw the "EPS" tab on the Import stack. However, I just tried it out, and it doesn't really import anything from an EPS file created with Illustrator 8. This happens on Mac OS X 10.2.6. After reading the documentation, it says only UNIX/X11 systems can display EPS. Is this true? If so, I'm a bit worried about a project I have to do where I was almost positive I could import EPS objects as graphics objects. Has anyone developed an alternate way of creating graphic objects out of EPS files? Karl ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metac> ard ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard