Yesterday, I installed the Gadget SDK. In a effort to understand
the programing logic of using the Gadget SDK kit. I have tried
some of the examples in the pdf.
The first concept I wanted to understand was how the lines and contours
are structured in Aspire 9.0+. Based on the documentation the key to
understand this concept is ... "ContourGroup Programing" on page 82 of the pdf.
Using the following example in the pdf;
-- iterate through the group and contours in group
local count = 0
local num_spans = 0
local span_length = 0.0
local tolerance = 0.0001
local pos = group:GetHeadPosition()
while pos ~= nil do
local contour
contour , pos = group:GetNext(pos)
-- iterate through each span in the contour
local ctr_pos = contour:GetHeadPosition()
while ctr_pos ~= nill do
local span
span, ctr_pos = contour:GetNext(ctr_pos)
num_spans = num_spans + 1;
span_length = span_length + span:GetLength(0.0001)
end
count = count + 1
end
---
After the correct structures around the code and verifying code was
added. A vector was selected and I ran the program.
I received an error on the following line:
>> local pos = group:GetHeadPosition()
After going back and reviewing the Constructor, I tried several
different ways to define the constructor ("group").
I'm looking for any ideas.
Daryl
Iterate through the group and contours in group
- Adrian
- Vectric Archimage
- Posts: 14690
- Joined: Thu Nov 23, 2006 2:19 pm
- Model of CNC Machine: ShopBot PRS Alpha 96x48
- Location: Surrey, UK
Re: Iterate through the group and contours in group
Look at the Contour_Creation_Example script that comes with the SDK.