BezierPenTool

Experimental projects, hacks, and other exploration of what is possible with SuperCard. Graphic files and .zip archives only.
Forum rules
Help keep this area clean by deleting attachments from existing posts that have been updated, or are no longer relevant.

BezierPenTool

Postby gonetriadrr » Fri Apr 01, 2011 11:17 am

Updated 1/29/12
See latest update info later in this thread.
DCS
Attachments
bezierPenTool-3r.zip
bezier polygon editor
(924.35 KiB) Downloaded 376 times
Last edited by gonetriadrr on Sun Jan 29, 2012 10:04 am, edited 13 times in total.
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby sctell » Fri Apr 01, 2011 11:40 pm

Hi,

I can't get it to launch, a quick flash in the menubar and it's gone.


10.6.7 with SC 4.6.3.
sctell
 
Posts: 1141
Joined: Sun Jul 06, 2008 10:41 am

Re: BezierPenTool

Postby sctell » Sat Apr 02, 2011 5:08 am

Hi,

I did get it to run by opening the package and running the project from there.
sctell
 
Posts: 1141
Joined: Sun Jul 06, 2008 10:41 am

Re: BezierPenTool

Postby Dan_Kelleher » Sat Apr 02, 2011 6:14 am

Using PPC OSX 10.5.8,
I see the same result; just a transient loading of the menus then closing.
Same result if the app is at the root of the hard drive or in the Applications folder.

and direct doubleClicking of the SuperCard project within the MDOx subfolder of Contents folder does open the project.
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: BezierPenTool

Postby Dan_Kelleher » Sat Apr 02, 2011 6:32 am

PPC OSX 10.5.8 SC 4.7.1

After opening the SC project, "bezierPenTool-3f.sc45", by doubleClicking,
and after clicking the enable button,
the "Conflicts" window opens and contains only, "Startup conflicts:"
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: BezierPenTool

Postby Dan_Kelleher » Sat Apr 02, 2011 6:38 am

Same results in SC 4.6.3 and 4.7.1

Also in either case, "Cmd M" does not open the message box.
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: BezierPenTool

Postby gonetriadrr » Sat Apr 02, 2011 11:01 am

sctell wrote:Hi,

I did get it to run by opening the package and running the project from there.


Looks as if applescript applets built under my os & platform aren't compatible or behave differently with newer/other.
Now i know.
Next update wont be packaged.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby gonetriadrr » Sat Apr 02, 2011 11:27 am

Dan_Kelleher wrote:PPC OSX 10.5.8 SC 4.7.1

After opening the SC project, "bezierPenTool-3f.sc45", by doubleClicking,
and after clicking the enable button,
the "Conflicts" window opens and contains only, "Startup conflicts:"


No front/backscript handlers loaded by other projects have like names as those of this project, so nothing is listed.
An oversight not to open the window at all if no conflicts are detected at startup.

Since i'm trying to determine if participation is worthwhile, since i'm an OS version or 2 behind, i'm dissapointed comments don't mention rendering results/problems.
Or did you not get that far?

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby Dan_Kelleher » Sat Apr 02, 2011 6:00 pm

i'm dissapointed comments don't mention rendering results/problems

can't have that! The system is working great! we are backing up your code here too! :-D

In the first example below
there is one path drawn using the BezierPenTool.
One can see where the bezier handles disappear
as well as when the "closePath" that the external "draws" is lost.
(I didn't look to see which XFcn, "THGraphics" or "CG" was actually called to do the deed)

In the second example below
there are multiple (two) paths drawn using the BezierPenTool.
The XFcn merges these separate SuperCard objects into one shined-and-polished SuperCard object.

Both screenshots were taken in SuperEdit where the background layer was filled with a blue graphic in order to show the transparency as well as the smoothness of the Supercard pictureData graphics produced.

Is there a way to erase while drawing with the BezierPenTool Project without the use of one of the three Runtime Editors or SuperEdit ? ( I make a lot of mistakes)
It would be nice to have the possibility of operating the BezierPenTool project in SC on it's own but have it provide, if possible, the ability to use old-fashioned Pointer tool selections followed by delete just to restart the drawing sequence. I presume disable --> enable would be required.
Hi-Res SC Drawing .jpg
Hi-Res SC Drawing .jpg (63.78 KiB) Viewed 12754 times

Grouping Bezier Objects.png
Grouping Bezier Objects.png (30.06 KiB) Viewed 12754 times
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: BezierPenTool

Postby sctell » Mon Apr 04, 2011 1:42 am

Hi,

The image below is a jpeg (to save on size) of an arc created with a pensize of 20 x 20.

Interestingly part of the stroked path has been lost.

I believe the reason for this is that the path is actually on the centre of the stroked line, thus if the image created is the size of actual path then part of the line will be lost.

The probable solution is to adjust the image size by the width of the line.

z2.jpg
z2.jpg (20.41 KiB) Viewed 12743 times
sctell
 
Posts: 1141
Joined: Sun Jul 06, 2008 10:41 am

Re: BezierPenTool

Postby gonetriadrr » Mon Apr 04, 2011 10:03 am

An update will be attached to the original message.

This version fixes a ton of bugs... no doubt adding more.
Render tool...
Renders all visible path polygons. No need to select.
Adds global shadow control to emulate a single CG transparency layer. Added Terry's colorpanel & colorspace externals there to set shadow color.
Automatically sizes the render bounds control box to accommodate line widths & shadow.

The project includes 3 path polygons to test render.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby sctell » Mon Apr 04, 2011 10:53 am

Hi,

Just playing around at the moment but when I delete all the objects from the test screen and then try to start again I get the following error

"can't find button field or graphic"

the script opens here:
Code: Select all
function ptTrunc p,places
if places is in "0" then return item 1 of p div 1 &","& item 2 of p div 1
put 10*places into nths
return ptDivide(ptTrunc(ptMultiply(p,nths)),nths)
end ptTrunc
sctell
 
Posts: 1141
Joined: Sun Jul 06, 2008 10:41 am

Re: BezierPenTool

Postby Dan_Kelleher » Mon Apr 04, 2011 11:03 am

PPC OSX 10.5.8 SC 4.7.1
rendering as described working well here.
I also now see the conext-dependent selection/delete etc etc options.
I just had not worked with it enough. sorry
working as described.jpg
working as described.jpg (62.14 KiB) Viewed 12735 times
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: BezierPenTool

Postby gonetriadrr » Mon Apr 04, 2011 11:14 am

sctell wrote:Hi,

Just playing around at the moment but when I delete all the objects from the test screen and then try to start again I get the following error

"can't find button field or graphic"

the script opens here:


Hmmm.
How are objects being deleted? Using the tool's contextual menu, or with SuperCards pointer tool?
To delete objects with pointer tool, disable the project first. Else, bad things happen.
Disabling the tool and re-enabling should clear things up.
If 'anchor handle' graphics get orphaned, the 'clear control objects' button on 'error recovery' tool card clear them.

That being said, occasionally the routines that track the ids of path polygon get fouled up by one or more unfound bugs. Id's of objects that are 'path polygons' are stored in a globals that aren't cleared if tool goes into bypass mode.

I really should add a trap to prevent bad deletions.
DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby gonetriadrr » Mon Apr 04, 2011 11:53 am

Dan_Kelleher wrote:PPC OSX 10.5.8 SC 4.7.1
rendering as described working well here.
I also now see the conext-dependent selection/delete etc etc options.I just had not worked with it enough. sorry
working as described.jpg


Almost everything has a contextual menu, an unselected path polygon displays a different menu than a selected path polygon. If more than one path polygon is selected, a contextual menu might be different than if only one is selected.
Anchor handle contextual menus when using the select tool offer a bunch of other functions that vary depending on a variety of conditions. With select tool, an anchor is selected if it is hilited. Multiple anchors of multiple paths may be selected. Click a path polygon with select tool to show anchor handles, then click, shift-click & option-drag, option-shift-drag to select/deselect anchor handles.

If the path polygons i left to test haven't been deleted...
Here's a rundown on some basics...
If you open the 'layers' palette from the contextual menu, hilite the first & last lines of the list, contextclick the list & choose 'hide'...

The remaining visible polygon is intended to have a raster image.
Click the remaining polygon using select tool or command-click with pen tool to select.
Or hilite in layers palette and select using the list field's contextual menu.

Next, context click the polygon, and select 'insert image file'...

from there...
Context-click the path again to set aspect, rotation, positioning.
These aren't the same as supercard properties, used to control pictdata control box & pictdata quads instead. All polygons with pictdata has its quad set.

Switch to 'image rotate' or 'image rotate' tools and drag the control handles of the selection box to manipulate.

Context-click the selection box to change aspect, rotation, positioning, etc.
The control box or pictdata should redraw to reflect the change.

Finally...
Show hidden path polygons using layers palette, or test window's contextual-menu.
Switch to render tool... render again.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby sctell » Mon Apr 04, 2011 11:22 pm

Hi,

The render test button has stopped working for me.

I choose an oval tool (concave)

set the line width in appearance.

set the fill color in appearance.

go to quartz render

set the shadow and color

press the render test button

it asks me to click on the test screen.

I do and all i get is a filled red square titled •Anchor,197,4 5x5 pixels.


Help please.
sctell
 
Posts: 1141
Joined: Sun Jul 06, 2008 10:41 am

Re: BezierPenTool

Postby gonetriadrr » Fri Apr 08, 2011 8:15 am

sctell wrote:Hi,

The render test button has stopped working for me.

I choose an oval tool (concave)

set the line width in appearance.

set the fill color in appearance.

go to quartz render

set the shadow and color

press the render test button

it asks me to click on the test screen.

I do and all i get is a filled red square titled •Anchor,197,4 5x5 pixels.


Help please.


The rendered image is inserted into a polygon which has supercard color settings.
The red color is likely the fillfore color.
If click the 'show fill' button in 'appearance' card of tool palette to toggle fill of selected polygons.
Can click polygon while cursor is bucket to update appearance as well.

If the polygon to be rendered has it's showfill set to false, the polygon shouldn't render unless it includes pictdata.

To preset appearance properties for new polygons...
Deselect all polygons.
Switch to appearance tool.
Change settings.
Switch to another editing tool.
The polygon created should adopt the new settings.

I'll test to make sure nothing is amiss with the oval tool.

Good luck.
DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby gonetriadrr » Fri Apr 08, 2011 8:23 am

Update attached to original message.

More bug fixes.

Adds delete item to layers palette list contextual menu.

Adds 'adopt image' & 'extract image' to pen & select tool contextual menus.
These create clipped & unclipped image clones of polygons that have pictdata.

Adds 'render selection' & 'quick render' contextual menu items.
Render without user intervention or dialogs.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby gonetriadrr » Mon Apr 25, 2011 11:27 am

Another update attached to original post.

More pictdata quad/aspect related bug fixes. 'Custom' aspect should be much more reliably managed.
Added colors palette.
Simplified gradient fill palette. Fixed a gradient palette related bug that could crash SuperCard.

Pictadata source images are now cached as files within the 'image' folder alongside the project file.
A md5 checksum is generated as new images are added so images that are alike are cached only once.
If i got the 4.7 syntax right, a single file is created under 4.7. Else, a second version with alpha scaled to 25% is also generated. In future, pictdata will be set by file reference.

Added pen/select tool 'gradient blend' & 'step blend contextual menu items. Example of 'gradient blend' below.
Both morph path geometry & color only. Both paths must be open or closed and must have same number of path segments.
The example below created using 'star' & 'polygon' tools to create the 2 original path polygons.

Native superCard...
native.png
native.png (10.48 KiB) Viewed 12697 times

THGraphics XFcn rendered...
thGraphics.png
thGraphics.png (48.69 KiB) Viewed 12697 times


Still lots of bugs.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby sctell » Sat Apr 30, 2011 11:32 pm

Out of interest there are a series of image files created in a folder titled image typically labeled

899782e.tif

I tried opening one of these files in preview and it came back

"It may be damaged or use a file format that Preview doesn’t recognize."

It does open in Pages and Numbers.

Whether or not you ever intend to use preview with these I don't know but I thought I would let you know.
sctell
 
Posts: 1141
Joined: Sun Jul 06, 2008 10:41 am

Re: BezierPenTool

Postby sctell » Sat Apr 30, 2011 11:45 pm

I would be interested in trying to understand the moire type patterning that is visible on my monitor in both the SC native version and the THGraphics version of the images above.

Can you create a THGraphics based script that produces this effect so that it could be studied more closely?
sctell
 
Posts: 1141
Joined: Sun Jul 06, 2008 10:41 am

Re: BezierPenTool

Postby gonetriadrr » Sun May 01, 2011 1:42 pm

sctell wrote:I would be interested in trying to understand the moire type patterning that is visible on my monitor in both the SC native version and the THGraphics version of the images above.

Can you create a THGraphics based script that produces this effect so that it could be studied more closely?


The moire in the native version is due to an optical illusion, banding. Photoshop adds stochastic dithering to eliminate the banding effect.

The morie in the rendered version is due to increased transparency along path edges. None of the paths overlap, they share path segment geometry where they meet.
Try aligning rectangles edge to edge and fill each with same transparent color.

The rendered graphic includes the instructions passed to thgraphics stored in the uPathStyleData user property.
The runtime editor's 'info' window is available by contextclicking a selected rendered graphic and select 'pass contextclick'. Or just disable the tool and access user properties normally.

DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby gonetriadrr » Sun May 01, 2011 1:53 pm

sctell wrote:Out of interest there are a series of image files created in a folder titled image typically labeled

899782e.tif

I tried opening one of these files in preview and it came back

"It may be damaged or use a file format that Preview doesn’t recognize."

It does open in Pages and Numbers.

Whether or not you ever intend to use preview with these I don't know but I thought I would let you know.


Hmmm...
Those are compressed tiff.
Path polygons which include a raster image display those images and are swapped when switching between preview & edit modes. Thus the 'e.tif' & 'p.tif' naming convention.

For instance...
In SC < 4.7, If a rendered image becomes more transparent when switching from 'appearance' tool to 'pen' tool. Image file swapping has been successful and all is well.

Thanks for the heads-up!
DCS
gonetriadrr
 
Posts: 170
Joined: Fri Jan 08, 2010 6:50 pm

Re: BezierPenTool

Postby Dan_Kelleher » Sun May 01, 2011 4:01 pm

Terry Wrote:
I tried opening one of these files in preview and it came back
"It may be damaged or use a file format that Preview doesn’t recognize."
It does open in Pages and Numbers.


David wrote:
Hmmm...
Those are compressed tiff.
Path polygons which include a raster image display those images and are swapped when switching between preview & edit modes. Thus the 'e.tif' & 'p.tif' naming convention.

For instance...
In SC < 4.7, If a rendered image becomes more transparent when switching from 'appearance' tool to 'pen' tool. Image file swapping has been successful and all is well.


The BezierPenTool-3i images
(200x200 RGB 1 alpha channel tifs)
Do open in Preview ver 4.2 in OSX 10.58 on PPC
-Dan


BezierPenTool-3i images.jpg
BezierPenTool-3i images.jpg (60.78 KiB) Viewed 12629 times
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: BezierPenTool

Postby Dan_Kelleher » Sun May 01, 2011 4:14 pm

And regarding a completely different subject: Can cursor resources be created in SuperEdit ?
How did you build all those cursors ?

When I have time I'll use SuperEdit to compose a list of images of the many BezierPenTool cursors and their names because I think it would help in discussing use of BezierPenTool.

Unless you already have such a list ?

Thank you for the Instructions on using BezierPenTool you gave on April 4. I have used them and I have some questions and comments but I've had no time to compose them.

David's instructions (see above, April 4) referred to the 3 paths in version BezierPenTool-3g (the film example).
-Dan
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Next

Return to The Lab

Who is online

Users browsing this forum: No registered users and 1 guest

cron