OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > General

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-02-2007, 13:23
Sablesword Sablesword is offline
Junior Member
 
Join Date: Aug 2006
Posts: 20
Default Circular tiling

I was looking through my copy of the old "Coreldraw Wow!" book and saw a reference to a Circular Tiling script. Unfortunately, the website referred to (www.tfts.i-us.com) is defunct, and googling couldn't find anything.

Does anyone here have a copy of that script they could post - or better yet, an updated VBA macro that does the same thing?
Reply With Quote
  #2  
Old 03-02-2007, 15:21
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Maybe

Not 100% sure what you are looking for, but try this:

Isocalc Radit

Hope that helps,

Shelby
Reply With Quote
  #3  
Old 12-02-2007, 01:02
Sablesword Sablesword is offline
Junior Member
 
Join Date: Aug 2006
Posts: 20
Default

The isocalc radit tool wasn't what I was looking for, but I found the old CD that came with the old "CorelDraw Wow" book - and it had the script. Even better, I was able to tweak the script to work with X3 (the old "CorelDraw.automation.7" -> "CorelDraw.automation.13" trick.)

I also tried to convert the script to a VB macro, and found that my VB-fu is weak, especially when it comes to forms. So here's the script for older & wiser heads to look at.

Code:
Rem Circular Tilings 
Rem Tales from the Script - January, 1997
Rem Tested on CorelDRAW v. 7
Rem
Rem Takes the selected object in CorelDRAW and tiles it
Rem radially.
Rem
Rem This program copyright Colin MacNeill, 1997-1998
Rem For more information read "Tales from the Script" in 
Rem the CorelDRAW Journal, or visit
Rem http://tfts.i-us.com, or write
Rem urtext@ns.sympatico.ca

' Defined variables:
' first, the dialog settings
Dim HScale as Integer		' Makes the area the item fits in
Dim VScale as Integer		' bigger or smaller.
Dim CircCount as Integer		' Count of "levels" to do
Dim OffsetDeg as Integer		' Rotate new circles this much
Dim Shrinkage as Integer		' Amout to scale successive circles
Dim RotateCheck as Integer	' Rotate the copies or not

' the rest of the variables
Dim ItemHeight as Long		' The dimensions of the selected
Dim ItemWidth as Long		' object
Dim CurItemHeight as Long	' The dimensions of the placed
Dim CurItemWidth as Long		' object
Dim CurLocationWidth as Long	' The size of the "location" the
Dim CurLocationHeight as Long	' placed object is put
Dim CurItemCount as Long		' Count of items in current circle
Dim CurRadius as Long		' Radius of current circle
Dim CurCircumfrence as Double	' Circle's circumfrence
Dim CurOffset
Dim CurXLoc as Long			' X centre of current item
Dim CurYLoc as Long			' Y centre of current item

' the dialog definition
BEGIN DIALOG CircTile 216, 70, "TFTS Circular Tiling"
	TEXT  5, 8, 73, 8, "Horizontal Scaling (%):"
	SPINCONTROL  80, 6, 32, 12, HScale
	TEXT  5, 22, 71, 8, "Vertical Scaling (%):"
	SPINCONTROL  80, 20, 32, 12, VScale
	TEXT  5, 34, 60, 8, "Number of circles:"
	SPINCONTROL  80, 33, 32, 12, CircCount
	TEXT  5, 48, 73, 19, "Offset between circles (deg.):"
	SPINCONTROL  80, 47, 32, 12, OffsetDeg
	TEXT  128, 8, 46, 10, "Shrinkage (%):"
	SPINCONTROL  175, 6, 32, 12, Shrinkage
	CHECKBOX  128, 21, 77, 10, "Rotate Copies?", RotateCheck
	OKBUTTON  170, 36, 40, 14
	CANCELBUTTON  170, 53, 40, 14
END DIALOG

' Constants
Global Const Pi as Double = 3.1415927
Dim DegRadConst as Double
DegRadConst = AngleConvert(1, 2, 360)

' OK, load the variables with default values
HScale = 100
VScale = 100
CircCount = 3
OffsetDeg = 0
Shrinkage = 100
CurRadius = ItemHeight
CurOffset = 0
RotateCheck = 1

' And let's start running.
' First, get stuff from the user
ret% = Dialog(CircTile)

If ret% = 2 then STOP

' and then to business
WithObject "CorelDraw.automation.7"
	' get info from Draw
	.GetSize ItemWidth, ItemHeight
	.CopyToClipboard
	CurItemWidth = ItemWidth
	CurItemHeight = ItemHeight
	
	' Now to start the main loops
	For i = 1 to CircCount	' loop for width of tiling
		CurLocationWidth = Int(CurItemWidth * (HScale/100))
		CurLocationHeight = Int(CurItemHeight * (VScale/100))
		CurOffset = CurOffset + OffsetDeg
		CurItemHeight = Int(CurItemHeight * (Shrinkage/100))
		CurItemWidth = Int(CurItemWidth * (Shrinkage/100))
		CurRadius = CurRadius + CurLocationHeight
		CurCircumfrence = CurRadius * Pi * 2
		CurItemCount = Int(CurCircumfrence/CurLocationWidth)

		For t = 1 to CurItemCount ' loop for specific band
			CurXLoc = Int(Sin(AngleConvert(1,2,CurOffset) + ((t/CurItemCount) * DegRadConst)) * CurRadius)
			CurYLoc = Int(Cos(AngleConvert(1,2,CurOffset) + ((t/CurItemCount) * DegRadConst)) * CurRadius)
			.PasteFromClipBoard
			.MoveObject CurXLoc, CurYLoc
			.StretchObject CurItemWidth, ItemWidth, CurItemHeight, ItemHeight, 0, 0, 9
			If RotateCheck = 1 then
				.RotateObject -(AngleConvert(1, 5, ((t/CurItemCount) * 360) + CurOffset)), -1, 0, 0
			End If
		Next t
	Next i
End WithObject
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PAINT 10 - Crop to a circular object colinstone General 1 07-05-2005 01:02


All times are GMT -5. The time now is 03:13.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com