News:

Be sure your post is relevant to the current discussion.  Create a new topic within the appropriate board if you are unsure.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Default Spline 'type' when Inserted as PPM

Started by Alvin Gregorio, September 11, 2020, 05:06:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Alvin Gregorio

Hello All,

When I insert a .ppm Spline that I created via the Parametric Parts Script Editor, it inserts as "Spline by Control Points".

Does anyone know of a default that I can change to get it to insert as a "Spline by Fit Points"?
___
After inserting the PPM script below, Explode once. Then enable "Show Frame".

S= Spline (Point (0,0,0), Point (0,10,1), Point (10,0,10));

Output (S)
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Andy H

HI Alvin.  I can't help with the problem as I don't use ppm's.

But.  In case you are unaware.  Spline by fit point is an interpretation made by TC.  Internally its a control point spline.  Essentially, fit point, is TC's 'best guess' as to where the spline should be.  And as such, it can be prone to errors.  I've seen it often where fit point looks good, but switching to control points, changes the shape of the spline.

Also there is no provision in the SDK to set 'fit point. Suggesting that 'fit points' is purely cosmetic.  Quote from the SDK " All intermediate control points are off-curve points. Note: Even if you create a curve using the Spline By Fit Points command in TurboCAD, the result is a spline with control points."

I do use 'fit point' but I always check the result using control point.

Bottom line. I may easily be wrong. But I doubt you will be able to set 'fit point' via ppm.

Henry Hubich

#2
Alvin, I pasted the following into the Parametric Part Script Editor. Now how do I make it draw a Spline?

S= Spline (Point (0,0,0), Point (0,10,1), Point (10,0,10));

Output (S)
[/color]

Henry H

Never mind; I finally figured it out. A bit of a PITA but certainly worthwhile to know (if I can just remember what I did--Help didn't help at all).

HH

Henry Hubich

Quote from: Andy H on September 11, 2020, 07:19:30 PM
HI Alvin.  I can't help with the problem as I don't use ppm's.

But.  In case you are unaware.  Spline by fit point is an interpretation made by TC.  Internally its a control point spline.  Essentially, fit point, is TC's 'best guess' as to where the spline should be.  And as such, it can be prone to errors.  I've seen it often where fit point looks good, but switching to control points, changes the shape of the spline.

Also there is no provision in the SDK to set 'fit point. Suggesting that 'fit points' is purely cosmetic.  Quote from the SDK " All intermediate control points are off-curve points. Note: Even if you create a curve using the Spline By Fit Points command in TurboCAD, the result is a spline with control points."

I do use 'fit point' but I always check the result using control point.

Bottom line. I may easily be wrong. But I doubt you will be able to set 'fit point' via ppm.

That's most interesting, Andy. Thanks for the inside info.

Henry H

Alvin Gregorio

Quote from: Andy H on September 11, 2020, 07:19:30 PM
...
But.  In case you are unaware.  Spline by fit point is an interpretation made by TC.  Internally...

Thanks Andy.  I'll do some research and reading and learning to see if and how I can use that knowledge.

I think I need to start with a basic knowledge of what a spline is, mathematically.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

I've been doing my learning-by-experimenting thing.
For the life of me, I can't get a handle one what "Maximum Degree" in Spline properties is.
It's not covered in the Help.

Does anyone understand what that it is/does enough to explain it in simple terms?
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Andy H

Quote from: Alvin Gregorio on September 12, 2020, 08:46:14 AM
For the life of me, I can't get a handle one what "Maximum Degree" in Spline properties is.
It's not covered in the Help.
Does anyone understand what that it is/does enough to explain it in simple terms?

That is an interesting question Alvin.  For me, I simply don't understand the maths involved to fully comprehend it.

For checking the maths, one needs to internet search for 'Cubic spline'. 

As for 'degree'.  It is nothing to do with 0 to 360 degrees,   But degrees of freedom. Which from what I understand limits the amount of figures or calculations a program can uses to draw the spline.   Increasing the degrees produces a smoother flatter spline, (if there are enough sections).

The degress set, can be limited by the number of nodes -1,  For example, If there are only 4 nodes, (3 frame sections), then setting degrees higher than 3 (say 5) shouldn't make any difference, because it doesn't need to use 5 calculations to draw the spline.

If there are 5 frames (6 nodes), setting degrees higher than 5 doesn't make any difference, Setting 5 produces a smoother (flatter) spline through nodes 2, 3 and 4,  Setting degree to 4 or 3 produces a more wavy spline.

The above affects drawing splines. One difference is if one alters the degrees of an existing spline. the spline is not re-drawn. instead it adds extra frame members, so as to maintian the existing curvature.

Confused yet :)  I am. 

The best way to check is.  Turn on 'show frame' and draw a 6 node wavy spline, like  sine waves, Start, end and 4 in between. At default setting  (3 degrees). Set its colur to red.  Draw a second spline at 5 degrees 6 nodes, snapping to the frame vertex points. Notice the difference in curvature.  Like I say, I don't understand the maths involved, to say why more degrees of freedong = smoother curve.

A last check. Draw another wavy spline 6 nodes as above, with show frames ticked. Make a copy and move it above the first, then change the copy degrees to 9.  Notice the amount of interpolated frame sections that have been added, in order to maintain the same curvature.

Generally.  The first and last nodes are not affected much, for a smoother (flatter) spline in between use a higher degree, for a normal wavy spline use lower degrees.

Alvin Gregorio

#7
Quote from: Andy H on September 12, 2020, 01:04:53 PM
...

That is an interesting question Alvin.  For me, ...

My experimenting (playing around actually) this morning lead me down some of the same paths and discoveries.

When I went on the Internet hunt-- knowing full-well that there was math behind all this-- I reinforced what I already was aware of:  To understand much of what I am inquisitive about, I have to start over in math learning, from about the now-8th-grade level.

"Polynomial Interpolation" seems to be the math that is used here.  But when I explore that, I am BLOWN AWAY by the terms and the symbols.
____
Reminds me of what occurred to me and somewhat overwhelmed me in my twenties when I was in college (never degreed)-- The more I learn the more I learn how little I actually know.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

So, I was thinking of having a go at creating a PPM for that tornado spline thing.

But since the PPM inserts from the data points as Spline control points, I sort of lost interest; because I think the input will never even sorta reflect the desired output.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Henry Hubich

#9
Quote from: Alvin Gregorio on September 12, 2020, 01:39:11 PM
So, I was thinking of having a go at creating a PPM for that tornado spline thing.

But since the PPM inserts from the data points as Spline control points, I sort of lost interest; because I think the input will never even sorta reflect the desired output.

Alvin, if you're referring to the curve in the attached .jpg, a Curve from Law can duplicate it. It's the black curve in the attached .tcw; yours is the red one.

x={169.86-170.62*[cos(u+0.1797)]}*cos(27.255*u)
y=-1*{169.86-170.62*[cos(u+0.1797)]}*sin(27.255*u)
z=170.62*sin(u+0.1797)-30.56

Umin=0; Umax=0.6916


Henry H

nikkipollard

#10
Thanks Alvin I didn't even know you could draw splines with ppms.
I have looked at splines before but gave up because of the maths.
I could figure out how to create a curve from control points.
But I have no idea how to calculate where the control points would be If I know the curve.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

murray dickinson

Quote from: Alvin Gregorio on September 12, 2020, 08:46:14 AM
I've been doing my learning-by-experimenting thing.
For the life of me, I can't get a handle one what "Maximum Degree" in Spline properties is.
It's not covered in the Help.

Does anyone understand what that it is/does enough to explain it in simple terms?

Try this, Alvin, seemed reasonable to me.  https://tinyurl.com/y3l9poca 


Henry Hubich

Alvin, can you create a Bezier with PPM?

Henry H

Henry Hubich

Next question, Alvin: How does one edit your PPM Spline (without exploding it first)?

Henry H

Alvin Gregorio

Quote from: Henry Hubich on September 13, 2020, 08:30:46 AM
Alvin, can you create a Bezier with PPM?

Henry H

Try:  In the PPSE palette, overwrite the word Spline in my little script with Bezier.
Play around with that some, by inserting it.  The Output is still S.

The above isn't optimal, it's just quick & rough & dirty... for experimenting.

Might have to get rid of the Z values, for starters.  Until we see if it will work/insert as a Bezier.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: Henry Hubich on September 13, 2020, 08:45:08 AM
Next question, Alvin: How does one edit your PPM Spline (without exploding it first)?

Henry H

We don't.  That was the quickest, simplest, little script that I wrote.  There are no Parameters.
One could very quickly and easily add Parameters to the script.  That's where I'm headed, with this whole tornado/vortex thing.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: murray dickinson on September 13, 2020, 08:30:12 AM
Quote from: Alvin Gregorio on September 12, 2020, 08:46:14 AM
I've been doing my learning-by-experimenting thing.
For the life of me, I can't get a handle one what "Maximum Degree" in Spline properties is.
It's not covered in the Help.

Does anyone understand what that it is/does enough to explain it in simple terms?

Try this, Alvin, seemed reasonable to me.  https://tinyurl.com/y3l9poca

Girlfriend is occupying my time this Sunday.
But I'm looking forward to getting more into this in the evenings this week (I live alone).

What you linked me to looks very interesting and informative Murray; I just hope I can navigate my way through the esoteric terms and symbols.
-Alvin
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: Alvin Gregorio on September 13, 2020, 12:08:45 PM
Quote from: Henry Hubich on September 13, 2020, 08:30:46 AM
Alvin, can you create a Bezier with PPM?

Henry H

Try:  In the PPSE palette, overwrite the word Spline in my little script with Bezier.
Play around with that some, by inserting it.  The Output is still S.

The above isn't optimal, it's just quick & rough & dirty... for experimenting.

Might have to get rid of the Z values, for starters.  Until we see if it will work/insert as a Bezier.

I'm not getting a Bezier to work/insert as a PPM.  I didn't expect I would.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#18
I am not sure how practical it is to work with curves in a ppm.
Unless it is a very simple curve. There seems to be a lot of maths and you cant loop through calculations.
You would also be limited to a fixed amount of points.
To be able to edit nodes in a ppm you use Parametric points but you cant add or remove them.

Your script would look something like this.

P0 = ParameterPoint(0, 0, 0, 0);
P1 = ParameterPoint(1,1000, 300, 0);
P2=ParameterPoint(2,2200, 500, 0);
P3=ParameterPoint(3,2000, 200, 0);

S=Spline(P0,P1,P2,P3)
P=Polyline(P0,P1,P2,P3)
P1=SetProperties(P,"PenColor"=255)
pr = RefPoint(PointX(P0),PointY(P0));

Output(pr,S,P1)

Which is pretty useless On its' own , the Spline or polyline Tools in TC do the same thing only more.
The Power with PPMs is what you do with the spline.
The Z coordinate of the parametric Point Doesn't work well- As soon as you move it it goes to the
workplane the ppm is on.









Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Andy H

Quote from: Alvin Gregorio on September 13, 2020, 08:34:36 PM
I'm not getting a Bezier to work/insert as a PPM.  I didn't expect I would.

Use spline but change it's properties to Bezier.  For example using Nikki's 'P0 etc.'  parameters. Try

cu = Spline(P0,P1,P2,P3)
cu1 = SetProperties(cu, "$SPLINETYPE" = 1)
Output (cu1)
The result is a Bezier, though whilst still in ppm mode (before exploding), one cannot access the Bezier control handles.

Andy H

#20
Quote from: nikkipollard on September 13, 2020, 10:26:24 PM

S=Spline(P0,P1,P2,P3)
P=Polyline(P0,P1,P2,P3)
P1=SetProperties(P,"PenColor"=255)
pr = RefPoint(PointX(P0),PointY(P0));


Nikki.   I assume P1 = Setproperties is a minor typo.  I changed it to P4 and it worked.   

To get the spline tighter to the frame, which may make it slightly more predictable. you could do something like below.  One can also turn the frame on (so the polyline is not required) by using "$SPLFRAME" = 1

S2 = SetProperties(S, "Degree" = 2)

Note - This just forces the degree value to 2, in case the user has changed it in spline properties,  The TC default is 3.

Alvin Gregorio

Andy, this $SPLINETYPE" = 1 and "$SPLFRAME" = 1 is good thinking.

It takes some out-of-the-box thinking and trial-&-error to work with PPMs; since the documentation is so minimal.

I look forward to exploring this more-- in the evening(s).
____
I too feel/think that working with curves as PPMs is probably very limited; but without a "... By Law" version of TurboCAD, using a PPM script seemed to be my best way of creating an adjustable 3D curve-- something like an adjustable logarithmic spiral or golden spiral.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#22
Alvin Does your version have ruby? - Being able to loop through calculations makes these tasks much less tedious.

I am interested to see how you create that funnel shape With A PPM.
If you figure out how to calculate Control points from fit points (or knots) Please share .

I Use ppms  for projects with linear or circular maths. Easy to parametise. (based on my limited math skills)
I have only ever needed a spiral for a rail on a Spiral staircase. Which was straight up and down - The sweep tool works Like a charm for that.

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

nikkipollard

Andy How do degrees work?
I can find a point on the spline that has the default degrees using equal percentages of the control lines.
But that would be wrong if the degrees changed.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Andy H

Quote from: nikkipollard on September 14, 2020, 05:48:12 AM
Andy How do degrees work?
I can find a point on the spline that has the default degrees using equal percentages of the control lines.
But that would be wrong if the degrees changed.

Hmm.  I only thought after I mentioned it. I may have just confused things more (sorry about that).  especially as I don't fully understand it myself.

See reply number 6 above.

I guess at its most basic level, If there are only 3 nodes (two frame sections), The maximum degrees of freedom is 2,  so the spline is the same, no matter what the degrees are set at (above 1).  Thus, the spline is more predictable. With more nodes (knots) and higher Degrees,  the spline is averaged out over a number of knots, up to the maximum set via the number of degrees. This produces a smoother flowing spline.  But is not easy to predict, unless one knows the calculations used (which, unfortunately I don't).

if one had 50 topographic data points of a hill top, and drew between each one, it could be a very zig-zag line, but if one averaged out at every 9 points the result would be much smoother.   At least that is my take on it.

Henry Hubich

#25
I seem to be able to Edit Fit Points only with a Degree 3 Spline.

If it is created as a Spline by Fit Points, increasing the "degree" before drawing results in more "control points"appearing when editing.

Henry H

Alvin Gregorio

Quote from: nikkipollard on September 13, 2020, 10:26:24 PM
I am not sure how practical it is to work with curves in a ppm.
Unless it is a very simple curve. There seems to be a lot of maths and you cant loop through calculations.
You would also be limited to a fixed amount of points.
To be able to edit nodes in a ppm you use Parametric points but you cant add or remove them.

Your script would look something like this.
...
Which is pretty useless On its' own , the Spline or polyline Tools in TC do the same thing only more.
The Power with PPMs is what you do with the spline.
The Z coordinate of the parametric Point Doesn't work well- As soon as you move it it goes to the workplane the ppm is on.

I couldn't get the Z Parameter to be "adjustable" either, using ParameterPoint.  I wasn't even having any success with the X or Y being Parametricly adjustable, using ParameterPoints.   But it seems that it can work-- the 3D_Spline Parametric Symbol being adjustable via Symbol Parameters.  The script below is the first of baby steps in the experimentation and discovery process.

Units(1[mm]);// means that default unit of drawing is millimeters

X1= Parameter ("X1",0,LINEAR);
Y1= Parameter ("Y1",0,LINEAR);
Z1= Parameter ("Z1",0,LINEAR);
//
X2= Parameter ("X2",50,LINEAR);
Y2= Parameter ("Y2",100,LINEAR);
Z2= Parameter ("Z2",50,LINEAR);
//
X3= Parameter ("X3",100,LINEAR);
Y3= Parameter ("Y3",50,LINEAR);
Z3= Parameter ("Z3",100,LINEAR);
//
X4= Parameter ("X4",50,LINEAR);
Y4= Parameter ("Y4",0,LINEAR);
Z4= Parameter ("Z4",50,LINEAR);

S=Spline(Point(X1,Y1,Z1),Point(X2,Y2,Z2),Point(X3,Y3,Z3),Point(X4,Y4,Z4));

P5=SetProperties(S,"PenColor"=255, "$SPLFRAME" = 1, "PenWidth"=.03);

Output(P5)
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: Henry Hubich on September 12, 2020, 02:43:18 PM
Quote from: Alvin Gregorio on September 12, 2020, 01:39:11 PM
So, I was thinking of having a go at creating a PPM for that tornado spline thing.

But since the PPM inserts from the data points as Spline control points, I sort of lost interest; because I think the input will never even sorta reflect the desired output.

Alvin, if you're referring to the curve in the attached .jpg, a Curve from Law can duplicate it. It's the black curve in the attached .tcw; yours is the red one.

x={169.86-170.62*[cos(u+0.1797)]}*cos(27.255*u)
y=-1*{169.86-170.62*[cos(u+0.1797)]}*sin(27.255*u)
z=170.62*sin(u+0.1797)-30.56

Umin=0; Umax=0.6916


Henry H

Thanks Henry.  I will be referring to this drawing and the formulas often, in my PPM experimenting.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Andy H

Quote from: Henry Hubich on September 14, 2020, 03:40:58 PM
I seem to be able to Edit Fit Points only with a Degree 3 Spline.

If it is created as a Spline by Fit Points, increasing the "degree" before drawing results in more "control points"appearing when editing.

Henry H

Well spotted.  Very strange.  I wouldn't even like to guess what is going on there. 

murray dickinson

In the example Ruby scripts, 3D polylines are called 3DPolylines (11), and whaddya know, "3D polyline" is the 11th command on the all-in command list, in the customize dialogue.   Having a look further down that list, 3D splines aren't called "3D splines", they're referred to as "By Control Points" and "By Fit Points".  Browsing through the SDK documentation, the 2D spline methods are CurveSpline and CurveBezier, while I haven't tripped over the ByControlPoints or ByFitPoints items yet.  The By Control Points and By Fit Points items haven't stayed in the same numerical position, they've been bumped down the command list in subsequent TC versions as new tools appeared, but 3D polyline sticks at number 11.     

nikkipollard

#30
Thanks Murray.
Alvin before you get too complicated with PPMs bare in mind that there is only a limited math  palette. available in the ppms. (Like half a scientific calculator)
I am not sure that you can do Logarithms and Exponents. I could be wrong though.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

nikkipollard

Alvin Have you had problems with your Library file crashing - with a ppm with a spline in it?
I tried to reload my library and it kept crashing when it got to the file with the spline.
Deleted the spline from the file and the library worked again.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: nikkipollard on September 16, 2020, 12:13:04 AM
Alvin Have you had problems with your Library file crashing - with a ppm with a spline in it?
I tried to reload my library and it kept crashing when it got to the file with the spline.
Deleted the spline from the file and the library worked again.

Version 21.2, Build 59.0 ProPlatinum:  No issue as you described
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

What's another way of writing an expression for an exponential?  Something like "a number multiplied by itself x number of times".

something along the lines of:

n=Number

(n*n) [done] x times
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

MM I don't know I only ever use Cubes and squares. Painful but not too difficult. I will try googling it. But most programs have "math" already
I am glad to hear the spline wasn't giving issues
There must be something wrong with my program.
On a totally different note - I see that you can create ellipses with PPms too - I never knew that either.  and
Unlike circles Ellipses will hatch. - Just a little bit of useless information.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Andy H

Quote from: Alvin Gregorio on September 16, 2020, 04:34:01 AM
What's another way of writing an expression for an exponential?  Something like "a number multiplied by itself x number of times".

something along the lines of:

n=Number

(n*n) [done] x times

They may have forgotten to program it. In some programming languages ** equals Exponential.  It is shown in the TC help file (though no explanation), and it is accepted in the ppm editor without showing an error.  But for me,  running a ppm with ** crashes TC every time without throwing up an error. 

I can't be certain that TC's interpretation of ** is meant to be exponential.  But ....  You could give it a try, and see if it crashes for you. (obviously using a blank file, not an important one).

Henry Hubich

Quote from: Alvin Gregorio on September 16, 2020, 04:34:01 AM
What's another way of writing an expression for an exponential?  Something like "a number multiplied by itself x number of times".

something along the lines of:

n=Number

(n*n) [done] x times

That approach is possible only if the "number of times" is a whole number. Although the concept is hard to visualize, in expressions such as n^x and exp(x), "x" does not have to be a whole number and in most cases it can even be negative.

Henry H

Alvin Gregorio

Quote from: nikkipollard on September 16, 2020, 05:46:24 AM
...
On a totally different note - I see that you can create ellipses with PPms too - I never knew that either.  and
Unlike circles Ellipses will hatch. - Just a little bit of useless information.

How did you make an Ellipse in a PPM, Nikki?
And how did you bump into it?
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#38
Quote from: Alvin Gregorio on September 16, 2020, 05:39:16 PM
Quote from: nikkipollard on September 16, 2020, 05:46:24 AM
...
On a totally different note - I see that you can create ellipses with PPms too - I never knew that either.  and
Unlike circles Ellipses will hatch. - Just a little bit of useless information.

How did you make an Ellipse in a PPM, Nikki?
And how did you bump into it?
I didn't I faked it.
The Same way I Work with curves - Dumb it down into arcs. Old School. I have my Father In laws' engineering drawing textbook - pre computers
I found the rectangular method to find Knots on the ellipse - You only have to calculate 3 or 4 intersection points. Then I drew Tangent arcs through the points.
Once you have those arcs you I can do anything with them - because the maths is easy.
I have made Elliptical shaped railing and curtain walls.  One of the ppm I shared can be exploded and converted to TC Architectural walls- Depending on the ellipse ratio. (If it is too close to a circle you get TC crazy) But That Polyline uses less intersection points so it isn't as close to an ellipse as the 4 intersection points In the Tc File. But To create an ellipse wall in my version of Tc you need to explode the ellipse first which gives you lots of little walls - which you cant really add windows or doors too.
The attached File explains My crazy system I did share the ppm a while ago.


Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

#39
Quote from: nikkipollard on September 17, 2020, 12:09:24 AM
Quote from: Alvin Gregorio on September 16, 2020, 05:39:16 PM
...
How did you make an Ellipse in a PPM, Nikki?
And how did you bump into it?
I didn't I faked it.
The Same way I Work with curves - Dumb it down into arcs. Old School. I have my Father In laws' engineering drawing textbook - pre computers
I found the rectangular method to find Knots on the ellipse - You only have to calculate 3 or 4 intersection points. Then I drew Tangent arcs through the points.
Once you have those arcs you I can do anything with them - because the maths is easy.
I have made Elliptical shaped railing and curtain walls.  One of the ppm I shared can be exploded and converted to TC Architectural walls- Depending on the ellipse ratio. (If it is too close to a circle you get TC crazy) But That Polyline uses less intersection points so it isn't as close to an ellipse as the 4 intersection points In the Tc File. But To create an ellipse wall in my version of Tc you need to explode the ellipse first which gives you lots of little walls - which you cant really add windows or doors too.
The attached File explains My crazy system I did share the ppm a while ago.


Thanks Nikki.

Now realizing an Ellipse is possible as a PPM, I tried below.  It works, except the Brush properties don't seem to want to apply (not too much work to select the just-inserted Parametric Symbol, do a Format/Create_Hatch, with "Associative hatch" enabled).
//Parametric Part: Ellipse
//
Units(1[in]); // means that default unit of drawing is inches
//
Ma=Parameter("Major Radius",20,LINEAR);
Mi=Parameter("Minor Radius",10,LINEAR);
//
E=Ellipse(Ma,Mi);
//
HE=SetProperties(E,"Brush" = "Solid");// "Hatched" ellipse

Output(HE)
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

I also just realised it. I only tried it because of the spline neither of them are in the help file.
Are you using  a solid brush? When I tested it with a solid brush it worked!
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: nikkipollard on September 17, 2020, 09:02:57 AM
I also just realised it. I only tried it because of the spline neither of them are in the help file.
Are you using  a solid brush? When I tested it with a solid brush it worked!

Nah, Brush doesn't work in PPM in my version-21.2PP.

That's Okay-- if I ever wanted/needed it, I'd just use that Format/Create_Hatch method.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: Alvin Gregorio on September 17, 2020, 05:02:57 PM
Quote from: nikkipollard on September 17, 2020, 09:02:57 AM
I also just realised it. I only tried it because of the spline neither of them are in the help file.
Are you using  a solid brush? When I tested it with a solid brush it worked!

Nah, Brush doesn't work in PPM in my version-21.2PP.

That's Okay-- if I ever wanted/needed it, I'd just use that Format/Create_Hatch method.

Well I'll be...  Just for the heck of it, I thought I'd see what MacroRecorder had for when I set a Brush to an Object.
It had "BrushStyle".  That worked.

When working with PPM scripts, just gotta open up the mind to all possibilities and try, and explore.

//Parametric Part: Ellipse
//
Units(1[in]); // means that default unit of drawing is inches
//
Ma=Parameter("Major Radius",20,LINEAR);
Mi=Parameter("Minor Radius",10,LINEAR);
BSty=Parameter("Brush Style","SOLID",TEXT);
BSca=Parameter("Brush Scale","1",LINEAR);
BSOr=Parameter("Brush Origin","0",LINEAR);
//
E=Ellipse(Ma,Mi);
//
HE=SetProperties(E,"BrushStyle"=BSty,"BrushScale"=BSca,"HatchOriginMode"=BSOr);// "Hatched" ellipse

Output(HE)


(I got sidetracked from my 3D Spline thing; I'll get back to it...)
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#43
HaHa Welcome to my world.
My door / window schedule project has been replaced with  a balustrade on a curve - based on as spline with 4 control points. Thanks.
I don't use hatches very often either. But I include a 2d plan in most of my symbols - To keep plans neat - I use A white solid hatch to hide Things I might not want to see in plan view.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

murray dickinson

TC fits curves to knot points, which actually are definitively on the curve itself.  If you nominate the "number of segments between adjacent control points" as 2, the lowest possible number, and explode the curve, each second vertex of the polyline is the fit/knot point of the original curve, even if it was created as a control point spline, and you can trace another curve by fit points through the second vertices of the polyline to reproduce it.   I think, from what I've read, that the curve segments between the knot points are Beziers, which is another can of worms to me, because their individual parametrisation is probably simpler, but they must be related to each other to maintain the tangency across the shared end points. 

nikkipollard

#45
Murray if you are trying to work with ppms - You don't want to explode the curve to find the knots. You need to calculate those knots If you need them.
It seems like a spline with 3 control points is a straight forward quadratic polynomial  and 4 control points uses a cubic polynomial but what type of spline are they using when you have more then 4 control points.
I thought it was a bspline but the frame seems skew.
I haven't figured out how to string the cubic polynomials together to get the Bezier spline although I vaguely understand the theory.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

murray dickinson

I don't think that you need more factors to use more control points, ie the order/degree isn't raised with additional control points. 

nikkipollard

#47
ha ha you have lost me.
I am working with high school maths  and a scripting language where you have to define things. You can't select something that was drawn and use the maths that was calculated previously by TC.
A lot of the tools available in TC aren't available in a PPM. - no trim, no divide no explode
For example , with the limited programming capabilities of a PPM, drawing a reasonable approximation of pattern on a spline, needs  creative alternatives to otherwise easy tasks.
You cant use loops in ppms So I find Going a bit backwards and converting the spline to a series of tangent arcs, using about 12 knots, is one way to overcome some of the hurdles. Arcs are easy to work with because the maths is uniform - so you don't need to loop

I know we have these tools but ppms are great for time consuming repetitive tasks.


Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

#48
Quote from: nikkipollard on September 26, 2020, 01:28:18 AM
...

I know we have these tools but ppms are great for time consuming repetitive tasks.

That was my initial thinking.  For that Forum member TurboCADer that wanted to "stretch a spline" to create a vortex or something.

It seemed they wanted to be able to experiment with different spiral maths.  So I thought a Parametric Symbol would be a good way to go.  Similar to using the Curve By Law tool, which my version doesn't have.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

.
Quote from: Alvin Gregorio on September 26, 2020, 05:29:47 AM

That was my initial thinking.  For that Forum member TurboCADer that wanted to "stretch a spline" to create a vortex or something.

It seemed they wanted to be able to experiment with different spiral maths.  So I thought a Parametric Symbol would be a good way to go.  Similar to using the Curve By Law tool, which my version doesn't have.


It might be possible - but the fact that you have to do each sum individually makes it really tedious. I have seen quite complex things done with sketchup and Ruby. Which is why I thought Ruby or the SDK would be a better way to work with complex curves. Baring in mind that with splines each control point adds a whole new level of complexity to the maths.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h