(EDIT: For those who are fluent in command line applications, John van Vliet has a quick alternative in the post immediately below this one. )
(NOTE: How fast this works will depend on the speed of your machine!)
If you've used the Asteroid Maker Spreadsheet, found here, you know that the output SSC code looks like this:
Code: Select all
# Generated with Asteroid Maker Version 1.6 on 2012-04-28 18:15:40.
# Reference plane: Inc = 73.4716, Asc Node = 259.3924
# Asteroids generated: 250
##############################################
# Asteroid 1 - Mass: 9.4907E+19 kg. Class: Normal. Moons: 0.
# Orbit family: Outer planet Trojan. Inc: 12.744787
"Asteroid 1" "Test Star" {
Class "asteroid"
Texture "juno.*"
Color [ 0.500 0.460 0.420 ]
Albedo 0.238
# No mesh
Radius 203.18
#BLANK
EllipticalOrbit {
Period 007.806619419895
SemiMajorAxis 3.037814720800
Eccentricity 0.124538419292
Inclination 062.2020
AscendingNode 265.8353
MeanLongitude 101.2883
LongOfPericenter 039.9133
#BLANK
}
Obliquity 143.9319
EquatorAscendingNode 013.1946
RotationOffset 039.6277
RotationPeriod 0005.065092609533
#BLANK
}
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
#BLANK
##############################################
# Asteroid 2 - Mass: 7.3012E+19 kg. Class: Normal. Moons: 0.
# Orbit family: Main Belt. Inc: 05.141894
"Asteroid 2" "Test Star" {
Class "asteroid"
Texture "ceres.*"
Color [ 0.300 0.300 0.300 ]
Albedo 0.113
Mesh "roughsphere.cms"
Radius 183.49
#BLANK
EllipticalOrbit {
Period 004.989857409931
SemiMajorAxis 2.254125199676
Eccentricity 0.066462466605
Inclination 073.8369
AscendingNode 264.7375
MeanLongitude 034.8486
LongOfPericenter 310.0781
#BLANK
}
Obliquity 037.4579
EquatorAscendingNode 020.4785
RotationOffset 328.7109
RotationPeriod 0007.633821692053
#BLANK
}
We all know that removing all of the superfluous "#BLANK" lines can be a big pain, but there is actually a quick and dirty way of removing all of these lines in just a few easy mouse and keyboard maneuvers.
For this, the text editing program Notepad++ is ABSOLUTELY REQUIRED!
This tutorial will assume you have both Asteroid Maker and Notepad++ installed and working on your machine.
Note: My version of Notepad++ is 5.9.6.2, so I don't know how far back before this this tutorial may work.
Step 1:
Generate your asteroid belt with the Asteroid Maker, select the entire first column on the "Celestia" page by clicking the capital "A". Copy and paste into an open window/tab on Notepad++.
First thing you will notice, you will notice a HUGE number of completely blank lines. The number of blank lines pasted into Notepad++ depends on your machine. On mine, I got about a million lines.
Step 2:
Open the "Find" Dialog box, which is under the "Search" menu, (or can be opened by clicking the binoculars on the toolbar or pressing "CTRL+F" on windows machines.) and type the name of the VERY LAST ASTEROID generated. I generated 250 asteroids, so for me, I type in "Asteroid 250". Make sure to click on the "Up" button in the "direction" section of the dialog box. This will tell Notepad++ which way to search. If you're at the top of the page (the very beginning of the file), select "Down".
Click the "Find Next" button, which will take you to the last asteroid that was generated.
Step 3:
Scroll down to the end of the definitions for that asteroid (if it has a moon, go to the end of that; if there's more than one, go to the end of the last moon), and left+click on that to put the cursor there.
Next, to select EVERYTHING after that line, go to the very bottom of the page, and while holding down "Shift", click the very last line. Everything between the end of the last asteroid's definition should be selected. Hit "Backspace" to delete it.
Close the "Find" dialog box.
Step 4:
This is the fun part.
Go to the very top of the page. See that very first "#BLANK"? Left+click on the very end of the PREVIOUS line, after the last digit. Keeping the mouse pointer at that spot, hold down the left mouse button, and drag down ONE line, so both the ending of that line AND the "#BLANK" are highlighted.
Now, go under the "Search" menu, and click on the "Replace" entry, to open the "Replace" dialog box. (Keyboard shortcut: CTRL+H; toolbar shortcut: the blue button right next to the binoculars.) The highlighted lines should already appear in the "Find what:" text box. Now, this will seem silly, but the "Replace with:" text box should be COMPLETELY EMPTY. If there's a word in there, DELETE IT. Make absolutely sure there are no spaces in there either.
Now, left+click on the "Replace All" button, and let the computer do all the work deleting all of the superfluous "#BLANK"s.
WARNING: HOW FAST THE "#BLANK"S ARE DELETED DEPENDS ON THE SPEED OF YOUR COMPUTER! SLOWER MACHINES WILL TAKE LONGER TO PROCESS THE REQUEST! ALSO, THE PROGRAM WILL NOT RESPOND WHILE IT IS PROCESSING THE REQUEST!
When it is all finished, the code should now look like this:
Code: Select all
# Generated with Asteroid Maker Version 1.6 on 2012-04-28 18:30:38.
# Reference plane: Inc = 73.4716, Asc Node = 259.3924
# Asteroids generated: 250
##############################################
# Asteroid 1 - Mass: 6.5542E+20 kg. Class: Normal. Moons: 0.
# Orbit family: Main Belt. Inc: 04.727306
"Asteroid 1" "Tutorial" {
Class "asteroid"
Texture "kleopatra.*"
Color [ 0.300 0.300 0.300 ]
Albedo 0.160
# No mesh
Radius 368.71
EllipticalOrbit {
Period 001.406838429008
SemiMajorAxis 0.969204508836
Eccentricity 0.054606875301
Inclination 068.7446
AscendingNode 259.4536
MeanLongitude 031.1133
LongOfPericenter 150.2051
}
Obliquity 110.5444
EquatorAscendingNode 094.9878
RotationOffset 126.7822
RotationPeriod 0007.287444247373
}
##############################################
# Asteroid 2 - Mass: 2.3755E+20 kg. Class: Normal. Moons: 0.
# Orbit family: Main Belt. Inc: 07.177536
"Asteroid 2" "Tutorial" {
Class "asteroid"
Texture "geographos.*"
Color [ 0.520 0.470 0.420 ]
Albedo 0.326
# No mesh
Radius 262.78
EllipticalOrbit {
Period 002.816804427216
SemiMajorAxis 1.539656147347
Eccentricity 0.068873447514
Inclination 072.8941
AscendingNode 266.8668
MeanLongitude 016.6992
LongOfPericenter 087.2424
}
Obliquity 011.5906
EquatorAscendingNode 057.0410
RotationOffset 194.5679
RotationPeriod 0026.880976807052
}
##############################################
# Asteroid 3 - Mass: 6.3811E+19 kg. Class: Normal. Moons: 0.
# Orbit family: Main Belt. Inc: 10.755349
"Asteroid 3" "Tutorial" {
Class "asteroid"
Texture "ky26.*"
Color [ 0.300 0.300 0.300 ]
Albedo 0.150
Mesh "proteus.cmod"
Radius 171.42
EllipticalOrbit {
Period 001.272856336403
SemiMajorAxis 0.906648338066
Eccentricity 0.166872865453
Inclination 083.0165
AscendingNode 254.3224
MeanLongitude 141.1633
LongOfPericenter 153.0835
}
Obliquity 036.1450
EquatorAscendingNode 275.9216
RotationOffset 216.3208
RotationPeriod 0031.897462105270
}
Note: If you have multiple asteroid belt files open at the same time, you can left+click the "Replace All in All Opened Documents". Granted, it will take extra time to process the request, but the results should be the same.
So, that's that. You should now have a "quick" and dirty way to trim your generated asteroid belts.
So far, it's working for me. Of course, whether or not this actually works for you will probably depend on multiple variables, including Notepad++ versions, machine specs, operating systems, etc.
Lemme know how well this works for you.
Have fun.