shapes.tbl

来自「一个不错的做图软件」· TBL 代码 · 共 775 行 · 第 1/2 页

TBL
775
字号
<?xml version="1.0" encoding="utf-8"?>
<vg version="723" range="0,0,800,553" paperbounds="0,0,827,1169" papervisible="false">
<sheet name="roundrect" visible="false" Offset="50">
<line name="line1" origin="-64,-72" points="24,0,6 72,0,2 85.254834,0,4 96,10.745166,4 96,24,4 96,24,2 96,37.254834,4 85.254834,48,4 72,48,4 24,48,2 10.745166,48,4 0,37.254834,4 0,24,4 0,24,2 0,10.745166,4 10.745166,0,4 24,0,5">
<programe>
<!--
published function OnNodeChange(Sender)
if Width > 0.00001 then
  n = Sender.PointCount - 1
  if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
    Offset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
    OnResize( this )
    return
  end if
  Sender.X[n] = Sender.X[0]
  Sender.Y[n] = Sender.Y[0]  
end if
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
ox=Left+Width/2
oy=Top+Height/2
x = Val( Offset ) * Width / 200
if x > Height / 2 then
  x = Height / 2
end if
y = x
EToBConst = 0.5522847498308
xe = x * EToBConst
ye = y * EToBConst
Line1.PointCount=17
Line1.x[0] = left + x; Line1.y[0] = top; Line1.Bytes[0] = 6
Line1.x[1] = right - x; Line1.y[1] = top; Line1.Bytes[1] = 2
Line1.x[2] = right - x + xe; Line1.y[2] = top; Line1.Bytes[2] = 4
Line1.x[3] = right; Line1.y[3] = top + y - ye; Line1.Bytes[3] = 4
Line1.x[4] = right; Line1.y[4] = top + y; Line1.Bytes[4] = 4
Line1.x[5] = right; Line1.y[5] = bottom - y; Line1.Bytes[5] = 2
Line1.x[6] = right; Line1.y[6] = bottom - y + ye; Line1.Bytes[6] = 4
Line1.x[7] = right - x + xe; Line1.y[7] = bottom; Line1.Bytes[7] = 4
Line1.x[8] = right - x; Line1.y[8] = bottom; Line1.Bytes[8] = 4
Line1.x[9] = left + x; Line1.y[9] = bottom; Line1.Bytes[9] = 2
Line1.x[10] = left + x - xe; Line1.y[10] = bottom; Line1.Bytes[10] = 4
Line1.x[11] = left; Line1.y[11] = bottom - y + ye; Line1.Bytes[11] = 4
Line1.x[12] = left; Line1.y[12] = bottom - y; Line1.Bytes[12] = 4
Line1.x[13] = left; Line1.y[13] = top + y; Line1.Bytes[13] = 2
Line1.x[14] = left; Line1.y[14] = top + y - ye; Line1.Bytes[14] = 4
Line1.x[15] = left + x - xe; Line1.y[15] = top; Line1.Bytes[15] = 4
Line1.x[16] = Line1.x[0]; Line1.y[16] = Line1.y[0];Line1.Bytes[16] = 5
end function
-->
</programe>
</sheet>
<sheet name="arc" visible="false" EndAngle="315" StartAngle="45">
<line name="line1" origin="-88,-100.224294" points="81.941125,85.716831,6 68.213222,99.444735,4 47.567566,103.551411,4 29.631195,96.121923,4 11.694825,88.692435,4 0,71.189893,4 0,51.775706,4 0,32.361518,4 11.694825,14.858976,4 29.631195,7.429488,4 47.567566,0,4 68.213222,4.106676,4 81.941125,17.83458,4">
<programe>
<!--
published function OnNodeChange(Sender)
EndAngle = CStr( PointToAngle( Sender.X[Sender.PointCount-1], Sender.Y[Sender.PointCount-1], Left + Width / 2, Top + Height / 2 ) )
OnResize( this )
end function
-->
</programe>
</line>
<line name="line2" origin="84,84" points="84,84,6">
<programe>
<!--
published function OnNodeChange(Sender)
StartAngle = CStr( PointToAngle( Sender.X[0], Sender.Y[0], Left + Width / 2, Top + Height / 2 ) )
OnResize( this )
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
PI = 3.14159265359 / 180
fragAngle=0
extent = Val( EndAngle ) - Val( StartAngle )
if( extent <= 0 )
	extent = extent + 360
end if
if( abs( extent ) <= 90 )then
	fragAngle = extent
	Nfrag = 1
else
	Nfrag = int(abs(extent)/90)+1
	fragAngle = extent / Nfrag
end if
rx = Width/2
ry = Height/2
mdx = Left+rx
mdy = Top+ry
fragAngle = fragAngle * PI
kappa = 4 / 3 * (1 - cos(fragAngle / 2)) / sin(fragAngle / 2)
theta0 = Val( StartAngle ) * PI
theta1 = theta0 + fragAngle
pc=3*Nfrag+1
k = 0
Line1.PointCount=pc
Line1.x[k] = mdx + rx * cos( theta0 )
Line1.y[k] = mdy + ry * sin( theta0 )
Line1.Bytes[k] = 6
k=k+1
i=0
while i < Nfrag
	cs0 = cos( theta0 )
	cs1 = cos( theta1 )
	sn0 = sin( theta0 )
	sn1 = sin( theta1 )
	Line1.x[k] = mdx + rx * ( cs0 - kappa * sn0 )
	Line1.y[k] = mdy + ry * ( sn0 + kappa * cs0 )
	Line1.Bytes[k] = 4
	k=k+1
	Line1.x[k] = mdx + rx * ( cs1 + kappa * sn1 )
	Line1.y[k] = mdy + ry * ( sn1 - kappa * cs1 )
	Line1.Bytes[k] = 4
	k=k+1
	Line1.x[k] = mdx + rx * cs1
	Line1.y[k] = mdy + ry * sn1
	Line1.Bytes[k] = 4
	k=k+1
	theta0 = theta0+fragAngle
	theta1 = theta1+fragAngle
	i=i+1
wend
end function
-->
</programe>
</sheet>
<sheet name="pie" visible="false" EndAngle="315" StartAngle="45">
<line name="line1" origin="-80,-92.224294" points="81.941125,77.716831,6 68.213222,91.444735,4 47.567566,95.551411,4 29.631195,88.121923,4 11.694825,80.692435,4 0,63.189893,4 0,43.775706,4 0,24.361518,4 11.694825,6.858976,4 29.631195,-0.570512,4 47.567566,-8,4 68.213222,-3.893324,4 81.941125,9.83458,4 48,43.775706,3 81.941125,9.83458,6">
<programe>
<!--
published function OnNodeChange(Sender)
EndAngle = CStr( PointToAngle( Sender.X[Sender.PointCount-1], Sender.Y[Sender.PointCount-1], Left + Width / 2, Top + Height / 2 ) )
OnResize( this )
end function
-->
</programe>
</line>
<line name="line2" origin="81.6,77.6" points="81.6,77.6,6">
<programe>
<!--
published function OnNodeChange(Sender)
StartAngle = CStr( PointToAngle( Sender.X[0], Sender.Y[0], Left + Width / 2, Top + Height / 2 ) )
OnResize( this )
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
PI = 3.14159265359 / 180
fragAngle=0
extent = Val( EndAngle ) - Val( StartAngle )
if( extent <= 0 )
	extent = extent + 360
end if
if( abs( extent ) <= 90 )then
	fragAngle = extent
	Nfrag = 1
else
	Nfrag = int(abs(extent)/90)+1
	fragAngle = extent / Nfrag
end if
rx = Width/2
ry = Height/2
mdx = Left+rx
mdy = Top+ry
fragAngle = fragAngle * PI
kappa = 4 / 3 * (1 - cos(fragAngle / 2)) / sin(fragAngle / 2)
theta0 = Val( StartAngle ) * PI
theta1 = theta0 + fragAngle
pc = 3 * Nfrag + 1
equal = ( Val( StartAngle ) = Val( EndAngle ) )
if not equal then
	pc = pc + 2
end if
k = 0
Line1.PointCount = pc
Line1.x[k] = mdx + rx * cos( theta0 )
Line1.y[k] = mdy + ry * sin( theta0 )
Line1.Bytes[k] = 6
k = k + 1
i = 0
while i < Nfrag
	cs0 = cos( theta0 )
	cs1 = cos( theta1 )
	sn0 = sin( theta0 )
	sn1 = sin( theta1 )
	Line1.x[k] = mdx + rx * ( cs0 - kappa * sn0 )
	Line1.y[k] = mdy + ry * ( sn0 + kappa * cs0 )
	Line1.Bytes[k] = 4
	k=k+1
	Line1.x[k] = mdx + rx * ( cs1 + kappa * sn1 )
	Line1.y[k] = mdy + ry * ( sn1 - kappa * cs1 )
	Line1.Bytes[k] = 4
	k=k+1
	Line1.x[k] = mdx + rx * cs1
	Line1.y[k] = mdy + ry * sn1
	Line1.Bytes[k] = 4
	k=k+1
	theta0 = theta0+fragAngle
	theta1 = theta1+fragAngle
	i=i+1
wend
if equal then
	Line1.Bytes[k-1] = Line1.Bytes[k-1] + 1
else
	Line1.x[k] = mdx
	Line1.y[k] = mdy
	Line1.Bytes[k] = 3
	k=k+1
	Line1.x[k] = Line1.x[k-2]
	Line1.y[k] = Line1.y[k-2]
	Line1.Bytes[k] = 6
end if
end function
-->
</programe>
</sheet>
<sheet name="trapezoid" visible="false" Offset="20">
<line name="line1" origin="-96,-80" points="0,96,6 96,96,2 72,0,2 24,0,3">
<programe>
<!--
published function OnNodeChange(Sender)
n = Sender.PointCount - 1
if Width > 0.00001 then
  if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
    Offset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
    OnResize( this )
    return
  end if
end if
Sender.X[n] = Left + Right - Sender.X[n-1]
Sender.Y[n] = Top
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = val( Offset ) * Width / 200
Line1.PointCount = 4
Line1.X[0] = Left; Line1.Y[0] = Bottom
Line1.X[1] = Right; Line1.Y[1] = Bottom
Line1.X[2] = Right - x; Line1.Y[2] = Top
Line1.X[3] = Left + x; Line1.Y[3] = Top
Line1.Bytes[3] = 3
end function
-->
</programe>
</sheet>
<sheet name="triangle" visible="false" Offset="50">
<line name="line1" origin="-152,-72" points="0,96,6 96,96,2 48,0,3">
<programe>
<!--
published function OnNodeChange(Sender)
n = Sender.PointCount - 1
if Width > 0.00001 then
  if Sender.X[n] >= Left and Sender.X[n] <= Right then
    Offset = CStr( ( Sender.X[n] - Left ) * 100 / Width )
    OnResize( this )
    return
  end if
end if
x = Val( Offset ) * Width / 100
Sender.X[n] = Left + X
Sender.Y[n] = Top
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( Offset ) * Width / 100
Line1.PointCount = 3
Line1.X[0] = Left; Line1.Y[0] = Bottom
Line1.X[1] = Right; Line1.Y[1] = Bottom
Line1.X[2] = Left + x; Line1.Y[2] = Top
Line1.Bytes[2] = 3
end function
-->
</programe>
</sheet>
<sheet name="diamond" visible="false">
<line name="line1" origin="-136,-80" points="48,0,6 0,48,2 48,96,2 96,48,3"/>
<programe>
<!--
private function OnResize(Sender)
Line1.PointCount = 4
Line1.X[0] = Left + Width /2; Line1.Y[0] = Top
Line1.X[1] = Left; Line1.Y[1] = Top + Height / 2
Line1.X[2] = Left + Width /2; Line1.Y[2] = Bottom
Line1.X[3] = Right; Line1.Y[3] = Top + Height / 2
Line1.Bytes[3] = 3
end function
-->
</programe>
</sheet>
<sheet name="parallelogram" visible="false" Offset="50">
<line name="line1" origin="-96,-64" points="0,96,6 48,96,2 96,0,2 48,0,3">
<programe>
<!--
published function OnNodeChange(Sender)
n = Sender.PointCount - 1
if Width > 0.00001 then
  if Sender.X[n] >= Left and Sender.X[n] <= Right then
    Offset = CStr( ( Sender.X[n] - Left ) * 100 / Width )
    OnResize( this )
    return
  end if
end if
Sender.X[n] = Left + Right - Sender.X[1]
Sender.Y[n] = Top
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = val( Offset ) * Width / 100
Line1.PointCount = 4
Line1.X[0] = Left; Line1.Y[0] = Bottom
Line1.X[1] = Right - x; Line1.Y[1] = Bottom
Line1.X[2] = Right; Line1.Y[2] = Top
Line1.X[3] = Left + x; Line1.Y[3] = Top
Line1.Bytes[3] = 3
end function
-->
</programe>
</sheet>
<sheet name="cross" visible="false" Offset="50">
<line name="line1" origin="-120,-104" points="24,24,6 0,24,2 0,72,2 24,72,2 24,96,2 72,96,2 72,72,2 96,72,2 96,24,2 72,24,2 72,0,2 24,0,3">
<programe>
<!--
published function OnNodeChange(Sender)
n = Sender.PointCount - 1
if Width > 0.00001 then
  if Sender.X[n] >= Left and Sender.X[n] <= Left + Width / 2 then
    Offset = CStr( ( Sender.X[n] - Left ) * 200 / Width )
    OnResize( this )
    return
  end if
end if
Sender.X[n] = Sender.X[0]
Sender.Y[n] = Top
end function
-->
</programe>
</line>
<programe>
<!--
private function OnResize(Sender)
x = Val( Offset ) * Width / 200
if x > Height / 2 then
  x = Height / 2
end if
Line1.PointCount = 12
Line1.X[0] = Left + x; Line1.Y[0] = Top + x
Line1.X[1] = Left; Line1.Y[1] = Top + x
Line1.X[2] = Left; Line1.Y[2] = Bottom - x
Line1.X[3] = Left + x; Line1.Y[3] = Bottom - x
Line1.X[4] = Left + x; Line1.Y[4] = Bottom
Line1.X[5] = Right - x; Line1.Y[5] = Bottom
Line1.X[6] = Right - x; Line1.Y[6] = Bottom - x
Line1.X[7] = Right; Line1.Y[7] = Bottom - x
Line1.X[8] = Right; Line1.Y[8] = Top + x
Line1.X[9] = Right - x; Line1.Y[9] = Top + x
Line1.X[10] = Right - x; Line1.Y[10] = Top
Line1.X[11] = Left + x; Line1.Y[11] = Top
Line1.Bytes[11] = 3
end function
-->
</programe>
</sheet>
<sheet name="pentagon" visible="false">
<line name="line1" origin="-88,-56" points="48,0,6 0,34.874041,2 18.334369,96,2 77.665631,96,2 96,34.874041,3"/>
<programe>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?