OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30-09-2004, 21:47
-=HKLC=-
Guest
 
Posts: n/a
Default Convert cure or segment to many Nodes

I want to convert a curve or a segment to many Nodes . What am I doing ?
Reply With Quote
  #2  
Old 02-10-2004, 19:47
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Convert cure or segment to many Nodes

I'm not sure what exactly you need. But if you need instead of one smooth Bezier segment a set of short line segments with quite a few nodes, you can easily do that in VBA.

You can get a point position along a segment at any given offset easily without even modifying the original curve. Here is a small macro which creates 10 small circles along each segment of the selected curve:

Code:
Sub MarkCurve()
    Dim seg As Segment
    Dim n As Long
    Dim t As Double
    Dim x As Double, y As Double
    For Each seg In ActiveShape.Curve.Segments
        For n = 0 To 10
            t = n / 10
            seg.GetPointPositionAt x, y, t
            ActiveLayer.CreateEllipse2 x, y, 0.05
        Next n
    Next seg
End Sub
You can also work with subpaths as a whole (not segment by segment basis).

Code:
Sub MarkCurve()
    Dim sp As SubPath
    Dim n As Long
    Dim t As Double
    Dim x As Double, y As Double
    For Each sp In ActiveShape.Curve.SubPaths
        For n = 0 To 40
            t = n / 40
            sp.GetPointPositionAt x, y, t
            ActiveLayer.CreateEllipse2 x, y, 0.05
        Next n
    Next sp
End Sub
Reply With Quote
  #3  
Old 04-10-2004, 20:30
-=HKLC=-
Guest
 
Posts: n/a
Default

thanks Alex
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
It is a bug? (Reflecting Nodes) Hernán General 0 26-10-2004 01:13
Reducing Nodes Semi Automatic Superfreak New product ideas 2 05-10-2004 02:10
Convert barcode to curves pp21 New product ideas 1 10-03-2004 22:56
Delete Segment Enhanced Hernán New product ideas 1 08-12-2003 15:04
Corel 10 file conversion script doesn't convert files Kevin CorelDRAW CS 0 13-04-2003 20:28


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


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