Hacking Complex Custom Fins Into RockSim

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

jqavins

Слава Україні
TRF Supporter
Joined
Sep 29, 2011
Messages
12,226
Reaction score
8,505
Location
Howard, NY
(Something similar to this may be applicable to OpenRocket, but that's not known to me.)

OK, so here's the challenge. I have a fin shape that I want to use in RS that has large curves I really want to get right. RS does let you make custom fin shapes, but the methods for placing points leaves a lot to be desired. Often I've found it much easier to lay out the points in a spreadsheet and then import them. But that's a feature RS does not have. So I hack it in. This involves opening the .rkt file in a plane text editor and altering it, so be sure to back up your rocket before attempting it, as there is a real possibility of corrupting it.

Here's one I did recently, and in the next several posts I'll walk you through how I did it.
529340-1698540423379511677657692040654.jpg
 
OK, so here's the challenge. I have a fin shape that I want to use in RS that has large curves I really want to get right. RS does let you make custom fin shapes, but the methods for placing points leaves a lot to be desired. Often I've found it much easier to lay out the points in a spreadsheet and then import them. But that's a feature RS does not have. So I hack it in. This involves opening the .rkt file in a plane text editor and altering it, so be sure to back up your rocket before attempting it, as there is a real possibility of corrupting it.

Here's one I did recently, and in the next several posts I'll walk you through how I did it.
Did you try the recommended method for entering raw points?

https://www.apogeerockets.com/Peak-of-Flight/Newsletter488
 
Did you try the recommended method for entering raw points?

https://www.apogeerockets.com/Peak-of-Flight/Newsletter488
What I did is a variation on that. I've done it that way in the past, and as I said the built in method for data entry leaves a lot to be desired. I find clicking in the X and then the Y box separately for each point a bit awkward compared to type-enter, type-enter down a column of Xs and then a column of Ys. Correcting errors is more awkward in RS directly than in a spreadsheet. If you're good with the recommended way, keep doing it. Here I present an alternative.
------------------------------------------------

The first step in the process is to create the list of points, obviously. Often I have a particular geometry in mind that I can describe in math, and I use one or more formulas to generate them. This time, I needed to duplicate an object that I already had in hand, so this time resembles the start of the recommended method at the start, more than many of my custom fins do.

I started by tracing the fin's outline on a piece of graph paper.
PXL_20231029_011428623.jpg
Next I picked points off the trace, spaced at what looked like reasonable intervals. When the line is nearly horizontal or about 45ish degrees, I went in 2 line increments on X, and when the line is close to vertical I went in two line intervals in Y. Moving around clockwise from the bottom left, I've only written down the Y values. when I get over the top of the curve, there's a point marked "35.2,15" and that's where I switched over to equal Y intervals, so below that Y is decreasing by twos and I'm only writing the Xs. The units are graph lines; converting to inches or millimeters while reading the points off the paper is just inviting mistakes.

Next, I type the numbers into a spreadsheet, still in units of grid lines. RS uses millimeters for all dimensions inside its design files; the units settings are only for display and input, but storage is millimeters. So, in another pair of columns I convert from grids to mm. Since this is quarter inch graph paper, the conversion factor is 25.4/4. Also, the values are stored in the .rkt file to one decimal place, so my formula rounds the converted lengths to that precision*. In another column, the X and Y are combined, with a comma in between, as a text string.

* The formula is "=ROUND(25.4*A4/4,1)"
1698544259967.png

I'll say again here, those points lists are, for me, computed more often than measured and typed.
 
Next comes the check plot. Make a chart using "X Y Scatter" from the converted (millimeter) columns. Show both vertical and horizontal grid lines, and set the grid intervals to the same value so that they form square boxes. Stretch or shrink the chart box to make the boxes square so that the shape of the graph is accurate.
1698544693074.png
 
So far, this has been the same tracing process as the method in Peak of Flight, and it seems like I'm adding extra steps. I'll say here for the last time that more often my points are computed, so I won't have typed the coordinates individually. Making the check plot and generating the combined coordinates as text strings, that is to say the extra parts, would be the same with computed points.

After this we're into the fiddly part, where hacking the .rkt file has to be done just exactly right, and it's past my bed time, so I'll get back to this tomorrow.
 
On reflection, if I have to explain that this is more useful for plan points that are computed, then I ought to use an example with them computed. So forget the half heart fin above, and I'll start over.

Let's say I'm building a rocket with a parabola theme: parabolic nose cone and parabolic fins to go with it. 50 mm root cord and 75 mm semi-span. (Probably a cannon ball with its parabolic trajectory for decals, but I digress.)

Most of it is quick and easy to design, but of course parabolic is not one of the available fin shapes, and it will take quite a few points to get the fin really looking right.

So, in my spreadsheet I autofill X values from 0 to 50 in steps of 2.5. Then I compute the Y values as 75-(75/625)*(X-25)^2. Here are the numbers and the check plot:
1698683637676.png
Note that I have (0,0) at both the top of the list and the bottom. That's so the check plot will form a complete, closed curve. I will only use the one at the bottom when I add these points to my .rkt file.
 

Attachments

  • 1698683266059.png
    1698683266059.png
    36.7 KB · Views: 1
Next, I create most of the rocket design in RS, using a placeholder set of custom fins. (Well, that's a lie; usually I do #9 next and this post after that, but this way makes for a better explanation.)
1698683922430.png
There are two important details here. First is that the origin point (0,0) is the leading end of the root cord, and second is that the points list starts from the aft end of the root cord and goes counterclockwise to end at the origin. RS takes care of that for you when you use this screen to enter your points, but when you hack them in you need to be sure to get those details right or your rocket will not be simulated correctly. (If you start at the origin and go clockwise, it ends up looking right but not simulating.)

Here's what the points look like inside the .rkt file. I've opened the file in Note Pad, and found the points list by searching for the creatively name XML tag "pointslist".
Code:
<PointList>112.776,0|97.4352,112.776|41.0472,112.776|0,0|</PointList>
(I made an incorect statement a few postws back, on Saturday. See it? The coordinates have more than one decima place.) OK, so, each point has its X and Y values separated by a comma, and there is a vertical bar character, "|", (shift-backslash on most Windows keyboards, I don't know on Macs) after each one. Also notice that the coordinates are in millimeters even though they are in inches on the RS screen. Which is why I specified the dimensions of the fin in mm.)

Next it's back to the spreadsheet.
 
Last edited:
In a new column, at the bottom row of coordinates (the one that's 0,0, row 22 in my case) enter "0,0|". Above this, enter a formula:
Code:
=A21&","&B21&"|"&C22
Copy that formula all the way up to row 2, but we don't want to include the (0,0) at the top. The great big string that is now in C2 is the points list we need to insert into the .rkt file.
 
With the last two steps complete (in either order) copy the contents of cell C2, and past that into to .rkt file in Word Pad, replacing the points list from the place holder fin.
Code:
<PointList>50,0|47.5,14.25|45,27|42.5,38.25|40,48|37.5,56.25|35,63|32.5,68.25|30,72|27.5,74.25|25,75|22.5,74.25|20,72|17.5,68.25|15,63|12.5,56.25|10,48|7.5,38.25|5,27|2.5,14.25|0,0|</PointList>
Save it, re-open it in RS, and here is the result.
1698685257815.png
Oops, I'll want to reposition those fins.
 
Back
Top