Re: [Pharo-users] [ANN] WIP iStoa

2014-04-14 Thread Bernat Romagosa
Hi Hilaire!

I'm on holidays now until next Tuesday, but I'll package a compiled VM for
you when I get back :)

Best,
Bernat.


2014-04-09 17:45 GMT+02:00 Hilaire Fernandes :

> LOL.
> So you have no choice but to prepare for me an archive with your
> compiled VM, so I will use it ;-) (my system use glibc 2.15 anyway)
>
> Hilaire
>
> Le 09/04/2014 14:29, Bernat Romagosa a écrit :
> > Ouch! I think it was myself who compiled it... I'll check again tomorrow!
> >
>
> --
> Dr. Geo http://drgeo.eu
>
>
>


-- 
Bernat Romagosa.


Re: [Pharo-users] Athens and ellipse drawing

2014-04-14 Thread Juraj Kubelka
Thank you Stef,the example helped me a lot to understand how to play with Athens. The solution is not what I am looking for. If someone starts to play with alpha canal, s/he will get unexpected results.I have finally found an example in C language. It look like this:-=-=-=-=-	cairo_set_line_width (cr, 0.1);	cairo_save (cr);	cairo_scale (cr, 1, 0.2);	cairo_arc (cr, 1.5, 1.5, 1, 0, 2 * M_PI);	cairo_restore (cr);        cairo_set_source_rgba (cr, 0, 1, 0, 0.50);	cairo_stroke (cr);-=-=-=-=-I do not know how to write the same instructions with Athens. First, they draw one arc (cairo_arc (cr, 1.5, 1.5, 1, 0, 2 * M_PI);), I draw 4 arcs:-=-=-=-=-canvas	createPath: [ :builder | 		builder			absolute;			moveTo: 0 @ 0.5;			ccwArcTo: 0.5 @ 0.0 angle: 90 degreesToRadians;			ccwArcTo: 0.0 @ -0.5 angle: 90 degreesToRadians;			ccwArcTo: -0.5 @ 0.0 angle: 90 degreesToRadians;			ccwArcTo: 0 @ 0.5 angle: 90 degreesToRadians ].-=-=-=-=-Second, they set line width, before any other action (like cairo_save). I do:-=-=-=-=-canvas pathTransform scaleBy: 200 @ 50.(can setStrokePaint: Color red) width: 0.1.can drawShape:  path.-=-=-=-=-So, my result in Athens is like this:Any idea? The example is explained here, C source code is here (by clicking on the image in the page).Thank you,JuraEl 12-04-2014, a las 4:01, Pharo4Stef  escribió:AthensSceneView newscene: [ :can |		| path |		path := cancreatePath: [ :builder | 	builder		absolute;		moveTo: 0 @ 0.5;		ccwArcTo: 0.5 @ 0.0 angle: 90 degreesToRadians;		ccwArcTo: 0.0 @ -0.5 angle: 90 degreesToRadians;		ccwArcTo: -0.5 @ 0.0 angle: 90 degreesToRadians;		ccwArcTo: 0 @ 0.5 angle: 90 degreesToRadians ].			can pathTransform			restoreAfter: [ 			can pathTransform scaleBy: 200 .			can setPaint: Color red ;drawShape:  path. 			"(athensCanvas setStrokePaint: strokePaint) width: (self strokeWidth / self scale) asFloat."			can drawShape:  path.].		can pathTransform			restoreAfter: [ 			can pathTransform scaleBy: 190 .			can setPaint: Color blue ;drawShape:  path. 			"(athensCanvas setStrokePaint: strokePaint) width: (self strokeWidth / self scale) asFloat."			can drawShape:  path 		]	] ;openInWindow

Re: [Pharo-users] Athens and ellipse drawing

2014-04-14 Thread Juraj Kubelka
El 14-04-2014, a las 8:21, Juraj Kubelka  escribió:Thank you Stef,the example helped me a lot to understand how to play with Athens. The solution is not what I am looking for. If someone starts to play with alpha canal, s/he will get unexpected results.I have finally found an example in C language. It look like this:-=-=-=-=-	cairo_set_line_width (cr, 0.1);	cairo_save (cr);	cairo_scale (cr, 1, 0.2);	cairo_arc (cr, 1.5, 1.5, 1, 0, 2 * M_PI);	cairo_restore (cr);        cairo_set_source_rgba (cr, 0, 1, 0, 0.50);	cairo_stroke (cr);-=-=-=-=-I do not know how to write the same instructions with Athens. First, they draw one arc (cairo_arc (cr, 1.5, 1.5, 1, 0, 2 * M_PI);), I draw 4 arcs:-=-=-=-=-canvas	createPath: [ :builder | 		builder			absolute;			moveTo: 0 @ 0.5;			ccwArcTo: 0.5 @ 0.0 angle: 90 degreesToRadians;			ccwArcTo: 0.0 @ -0.5 angle: 90 degreesToRadians;			ccwArcTo: -0.5 @ 0.0 angle: 90 degreesToRadians;			ccwArcTo: 0 @ 0.5 angle: 90 degreesToRadians ].-=-=-=-=-OK, now I can draw ellipse with just one arc:-=-=-=-canvas	createPath: [ :builder | 		builder			absolute;			moveTo: 0.5 @ 0; 			arcCenterX: 0 centerY: 0 radius: 0.5 startAngle: 0 endAngle: Float twoPi-=-=-=-Why is this method in private protocol? Why I should not use it?Why I have to use “moveTo:”? In C-example they do not use it. But I have to, otherwise there is an extra line on the canvas:Well, I see in AthensCairoPathBuilder>>createPath:, there is call of "self moveToX: 0 Y: 0.”. If I remove it, I do not have to write “moveTo: 0.5@0”. So, I understand why I have to write it in my code. The question is what is the purpose of "self moveToX: 0 Y: 0.”? I guess it simplify some situations, am I right? Which one?There is actual Athens example:-=-=-=-AthensSceneView new scene: [ :can |		| path |		path := can createPath: [ :builder | 	builder		absolute;		moveTo: 0.5 @ 0;		arcCenterX: 0 centerY: 0 radius: 0.5 startAngle: 0 endAngle: Float twoPi ].		can pathTransform restoreAfter: [ 			can pathTransform scaleBy: 200 @ 50.			(can setStrokePaint: Color red) width: 0.1.			can drawShape:  path.			].		] ;openInWindow-=-=-=-Thank you,JurajSecond, they set line width, before any other action (like cairo_save). I do:-=-=-=-=-canvas pathTransform scaleBy: 200 @ 50.(can setStrokePaint: Color red) width: 0.1.can drawShape:  path.-=-=-=-=-So, my result in Athens is like this:Any idea? The example is explained here, C source code is here (by clicking on the image in the page).Thank you,JuraEl 12-04-2014, a las 4:01, Pharo4Stef  escribió:AthensSceneView newscene: [ :can |		| path |		path := cancreatePath: [ :builder | 	builder		absolute;		moveTo: 0 @ 0.5;		ccwArcTo: 0.5 @ 0.0 angle: 90 degreesToRadians;		ccwArcTo: 0.0 @ -0.5 angle: 90 degreesToRadians;		ccwArcTo: -0.5 @ 0.0 angle: 90 degreesToRadians;		ccwArcTo: 0 @ 0.5 angle: 90 degreesToRadians ].			can pathTransform			restoreAfter: [ 			can pathTransform scaleBy: 200 .			can setPaint: Color red ;drawShape:  path. 			"(athensCanvas setStrokePaint: strokePaint) width: (self strokeWidth / self scale) asFloat."			can drawShape:  path.].		can pathTransform			restoreAfter: [ 			can pathTransform scaleBy: 190 .			can setPaint: Color blue ;drawShape:  path. 			"(athensCanvas setStrokePaint: strokePaint) width: (self strokeWidth / self scale) asFloat."			can drawShape:  path 		]	] ;openInWindow