Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Doubt is not a pleasant condition, but certainty is absurd. -- Voltaire


devel / comp.lang.tcl / ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters

SubjectAuthor
* ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric paramclt.to.davebr
`* Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric pHelmut Giese
 `* Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric pclt.to.davebr
  `- Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric pgreg

1
ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters

<84717124184371003@llp>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13243&group=comp.lang.tcl#13243

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: clt.to.d...@dfgh.net
Newsgroups: comp.lang.tcl
Subject: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters
Date: Sat, 06 Apr 24 15:47:17 GMT
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <84717124184371003@llp>
Injection-Date: Sat, 06 Apr 2024 15:47:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="62673d5e6420ae7518684fa8762317d9";
logging-data="2284920"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+k/TPl6KlZAC3C34z32CiE"
Cancel-Lock: sha1:9AXdq8WMjOCDkGPLn61YQ6uYZ2E=
 by: clt.to.d...@dfgh.net - Sat, 6 Apr 2024 15:47 UTC

see ccanvas on chiselapp.com

I use ccanvas where exact sizes matter. It has been useful making templates for small parts, or checking layouts or part fit up.

ccanvas should act like a canvas with added features:

Any numeric argument can be an expression using canvas units, tcl variables, and x,y coordinates from an associated coordinate list. Like Tcl expr, it is wise, but not always necessary, to brace expressions.

..c create line $xo $yo x+1.5i y x=x1 y+5c=y1 x(0) y -width 1.7m -fill red

draws a line 1.7 mm wide, starting at the coordinates in $xo $yo, then right 1.5 inches, then down 5 centimeters, finally back left directly below the first point. The lower right most coordinates are saved in tcl variables x1, y1

ccanvas unit scaling can be set for each ccanvas using the -scale option.

-scrollregion can be set so the 0,0 point is at any of the common Tk anchor points (centered, n, ne ...) of the window (or in the normal way using 4 coordinates)

New sub commands:

dup -- duplicates tagged items, making changes to their options (in particular -tags -addtags -dtags)

flip -- mirror item coordinates in a vertical line (flip right or left)

flop -- mirror item coordinates in a horizontal line (flop down or up)

crotate -- is a different take on rotation from Tk 8.7 rotate (ccanvas supports rotate if the underlying canvas does)

expr -- returns the result of an expression in the ccanvas context

exprs -- returns a list of results from multiple expressions.

All the calculations are done using Tcl expr, so all its operators and functions are available. Lengths are converted to pixels before Tcl expr gets them. Angle arguments to trig functions (sin cos tan) are converted to radians for use in Tcl expr. Angle results from inverse trig functions (asin acos, atan) are converted back to degrees (canvas default angle units) before further use in the expression. Note no sanity checks are done on unit use! sin(5i) will not give an error, but I doubt the result would be useful.

I've been using some of the expression evaluation code for a few years, so that is pretty stable. The new subcommands might change (crotate in particular).

This is implemented as a snit widgetadapter. It is easy to add new subcommands (just add a new snit method).

If you try it and find something odd, or wrong let me know.

dave b

Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters

<ie931jtupuo8729c4tdq2jkjm13ljv37hv@4ax.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13244&group=comp.lang.tcl#13244

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: hgi...@ratiosoft.com (Helmut Giese)
Newsgroups: comp.lang.tcl
Subject: Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters
Date: Sat, 06 Apr 2024 21:45:14 +0200
Organization: ratiosoft
Lines: 4
Message-ID: <ie931jtupuo8729c4tdq2jkjm13ljv37hv@4ax.com>
References: <84717124184371003@llp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 06 Apr 2024 19:45:13 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="330c58688d4abaa9fd6cb05e43fa74aa";
logging-data="2391677"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EJl2MV1XGTjcGSv56XRGQ"
Cancel-Lock: sha1:BubujBflMb5uRA4UnsOhyaGspWI=
X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
 by: Helmut Giese - Sat, 6 Apr 2024 19:45 UTC

Hi dave,
sounds interesting.
Q: Can it be used with TkPath instead of the normal Tk canvas?
Helmut

Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters

<92917124487041001@llp>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13245&group=comp.lang.tcl#13245

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: clt.to.d...@dfgh.net
Newsgroups: comp.lang.tcl
Subject: Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters
Date: Sun, 07 Apr 24 00:11:44 GMT
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <92917124487041001@llp>
References: <84717124184371003@llp> <ie931jtupuo8729c4tdq2jkjm13ljv37hv@4ax.com>
Injection-Date: Sun, 07 Apr 2024 00:12:08 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="677adb1515eb663197d3285d986fd907";
logging-data="2512042"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/43pAdh/Ev1hwozxkD7KGp"
Cancel-Lock: sha1:Lwor1vrhUdW93uha7jE4Ro9P2e4=
In-Reply-To: <ie931jtupuo8729c4tdq2jkjm13ljv37hv@4ax.com>
 by: clt.to.d...@dfgh.net - Sun, 7 Apr 2024 00:11 UTC

>From: Helmut Giese <hgiese@ratiosoft.com>
>Date: Sat, 06 Apr 2024 21:45:14 +0200
>Subject: Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters

>Q: Can it be used with TkPath instead of the normal Tk canvas?
The TkPath subcommands are different from canvas, so ccanvas could not use it as the snit hull component. However the core calculation code might be usable.

Where can the latest TkPath code be found?

dave b

Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters

<uuthh4$2legh$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13246&group=comp.lang.tcl#13246

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.e...@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: ccanvas -- a cavvas wrapper that allows calculated coordinates
and numeric parameters
Date: Sun, 7 Apr 2024 09:21:08 +0200
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <uuthh4$2legh$1@dont-email.me>
References: <84717124184371003@llp>
<ie931jtupuo8729c4tdq2jkjm13ljv37hv@4ax.com> <92917124487041001@llp>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 07 Apr 2024 07:21:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7ae1b6ba3e4fd6c1606dda05800914f9";
logging-data="2800145"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19U4tXwD18/NnmEZ42foq2xgIhp2dnQSrA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:uBT6VOIA3VI9oPPGdwQapfeshqU=
Content-Language: de-DE
In-Reply-To: <92917124487041001@llp>
 by: greg - Sun, 7 Apr 2024 07:21 UTC

Am 07.04.24 um 02:11 schrieb clt.to.davebr@dfgh.net:
>> From: Helmut Giese <hgiese@ratiosoft.com>
>> Date: Sat, 06 Apr 2024 21:45:14 +0200
>> Subject: Re: ccanvas -- a cavvas wrapper that allows calculated coordinates and numeric parameters
>
>> Q: Can it be used with TkPath instead of the normal Tk canvas?
>
> The TkPath subcommands are different from canvas, so ccanvas could not use it as the snit hull component. However the core calculation code might be usable.
>
> Where can the latest TkPath code be found?
>
> dave b
>

Is part of androwish and bawt.

https://wiki.tcl-lang.org/page/tkpath

https://wiki.tcl-lang.org/page/AndroWish

https://www.tcl3d.org/bawt/

or

https://wiki.tcl-lang.org/page/tko

greg

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor