16

**ASL Scripts / "Ring" parametric shape plugin**

« **on:**January 29, 2009, 07:51:01 am »

Here is the "ring" parametric shape plugin i've made. I hope it serves You well as serves me.

- October 17, 2019, 09:40:38 pm
- Welcome,
*Guest*

An update to Anim8or, **v1.00b**, is available with a few bug fixes. Get your copy **HERE**. See the "ReadMe" file for details.

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Pages: 1 [**2**]

16

Here is the "ring" parametric shape plugin i've made. I hope it serves You well as serves me.

17

Unfortunately, the critical parameters are 17 - 4 for hull and 13 for freeboard.

I thought to make one plugin for hull and one for freeboard, but parameter count is still larger than 10.

The other option is to make a plugin with predefined board shape, but then the generated ship ill not be fully customizable.

I thought to make one plugin for hull and one for freeboard, but parameter count is still larger than 10.

The other option is to make a plugin with predefined board shape, but then the generated ship ill not be fully customizable.

18

Hello!

Looking at the SpringSharp software http://www.springsharp.com/ (used to design virtual warships), i've got following idea: It will be good to have visual 3D model of the designed ship (ShpringSharp gives only text data), and i've realised that it is possible.

I'm writing a script, where by specifying few ship's parameters, you can receive a 3D model of this ship.

Here is the current version of the script. I'm still working on it. Later will be implemented calculation of different block coefficients ("fatness") of the ship (for now block coefficient can be only 0.523 - corresponding to a cruiser).

This version implement "Cruiser stern". In later versions, i'll try to implement also transom and round sterns as a choice.

To create your own ship 3D model, open the script file , and modify the parameters on top of the script:

float $WLL; $WLL = 192; /*waterline length*/

float $WLB; $WLB = 20.8; /*beam*/

float $WLD; $WLD = 4.9; /*drought*/

float $BCF; $BCF = 6.1; /*Board Forecastle Front*/

float $BCA; $BCA = 5.3; /*Board Forecastle Aft*/

float $BFF; $BFF = 5.3; /*Board Fore Deck Front*/

float $BFA; $BFA = 5.3; /*Boatd Fore Deck Aft*/

float $BAF; $BAF = 3.0; /*Board Aft Deck Front*/

float $BAA; $BAA = 3.0; /*Boatd Aft Deck Aft*/

float $BQF; $BQF = 3.0; /*Board Quarterdeck Front*/

float $BQA; $BQA = 3.0; /*Boatd Quarterdeck Aft*/

float $ANGB; $ANGB = 20; /*bow angle*/

float $PFC; $PFC = 20; /*forecastle as percent of the hull length*/

float $PFD; $PFD = 30;/*fore deck as percent of the hull length*/

float $PQD; $PQD = 20;/*quarterdeck as percent of the hull length*/

float $PAD; $PAD = 100 - $PFC - $PFD - $PQD; /*aft deck as percent of the hull length*/

All data is in meters.

Looking at the SpringSharp software http://www.springsharp.com/ (used to design virtual warships), i've got following idea: It will be good to have visual 3D model of the designed ship (ShpringSharp gives only text data), and i've realised that it is possible.

I'm writing a script, where by specifying few ship's parameters, you can receive a 3D model of this ship.

Here is the current version of the script. I'm still working on it. Later will be implemented calculation of different block coefficients ("fatness") of the ship (for now block coefficient can be only 0.523 - corresponding to a cruiser).

This version implement "Cruiser stern". In later versions, i'll try to implement also transom and round sterns as a choice.

To create your own ship 3D model, open the script file , and modify the parameters on top of the script:

float $WLL; $WLL = 192; /*waterline length*/

float $WLB; $WLB = 20.8; /*beam*/

float $WLD; $WLD = 4.9; /*drought*/

float $BCF; $BCF = 6.1; /*Board Forecastle Front*/

float $BCA; $BCA = 5.3; /*Board Forecastle Aft*/

float $BFF; $BFF = 5.3; /*Board Fore Deck Front*/

float $BFA; $BFA = 5.3; /*Boatd Fore Deck Aft*/

float $BAF; $BAF = 3.0; /*Board Aft Deck Front*/

float $BAA; $BAA = 3.0; /*Boatd Aft Deck Aft*/

float $BQF; $BQF = 3.0; /*Board Quarterdeck Front*/

float $BQA; $BQA = 3.0; /*Boatd Quarterdeck Aft*/

float $ANGB; $ANGB = 20; /*bow angle*/

float $PFC; $PFC = 20; /*forecastle as percent of the hull length*/

float $PFD; $PFD = 30;/*fore deck as percent of the hull length*/

float $PQD; $PQD = 20;/*quarterdeck as percent of the hull length*/

float $PAD; $PAD = 100 - $PFC - $PFD - $PQD; /*aft deck as percent of the hull length*/

All data is in meters.

19

This is the scripts:

dome_5_8.txt - 5/8 simple geodesic dome

dome_6_8.txt - 6/8 simple geodesic dome

new-dome_5_8.txt - 5/8 geodesic dome with construction elements (cylinders on edges and spheres connecting the cylinders)

dome_5_8.txt - 5/8 simple geodesic dome

dome_6_8.txt - 6/8 simple geodesic dome

new-dome_5_8.txt - 5/8 geodesic dome with construction elements (cylinders on edges and spheres connecting the cylinders)

20

yes, but i've not included this in the sample:

float $PI2;

$PI2 = 3.14159265358979323846;

float $CylRad;

$CylRad = 0.018;

actually, i'm using this script to build a geodesic dome

soon i will finish script and can publish it if someone is interested.

This is the result of the script:

float $PI2;

$PI2 = 3.14159265358979323846;

float $CylRad;

$CylRad = 0.018;

actually, i'm using this script to build a geodesic dome

soon i will finish script and can publish it if someone is interested.

This is the result of the script:

21

now everything works ok, i'm using old version of anim8or with wrong PI!

22

I've tried this:

....

$index[0] = $mymesh.AddPoint((0.000000, 1.000000, 0.000000));

$index[1] = $mymesh.AddPoint((0.343292, 0.939229, 0.000000));

....

float $rx, $ry, $rz;

point3 $p1, $p2;

$p1 = $mymesh.GetPoint($index[0]);

$p2 = $mymesh.GetPoint($index[1]);

float $CylLen;

$CylLen = sqrt(pow($p1.x-$p2.x, 2) + pow($p1.y-$p2.y, 2) + pow($p1.z-$p2.z, 2));

shape $cyl0;

$cyl0 = cylinder($CylRad, $CylLen);

$cyl0.lon = 8;

$cyl0.lat = 1;

$cyl0.CapStart = 0;

$cyl0.CapEnd = 0;

$cyl0.loc = ($p2.x, $p2.y, $p2.z);

$rx = 0;

if(($p1.x-$p2.x) < 0) { $ang = 180; } else { $ang = 0; }

$ry = $ang + atan(($p1.z-$p2.z)/($p1.x-$p2.x)) * 180.0 / $PI2;

$rz = acos(($p1.y-$p2.y) / $CylLen ) * 180.0 / $PI2;

$cyl[$i].orientation = RPYtoQuaternion($rx, $ry, $rz);

it ALMOST works. The cylinder is positioned not very precise.

....

$index[0] = $mymesh.AddPoint((0.000000, 1.000000, 0.000000));

$index[1] = $mymesh.AddPoint((0.343292, 0.939229, 0.000000));

....

float $rx, $ry, $rz;

point3 $p1, $p2;

$p1 = $mymesh.GetPoint($index[0]);

$p2 = $mymesh.GetPoint($index[1]);

float $CylLen;

$CylLen = sqrt(pow($p1.x-$p2.x, 2) + pow($p1.y-$p2.y, 2) + pow($p1.z-$p2.z, 2));

shape $cyl0;

$cyl0 = cylinder($CylRad, $CylLen);

$cyl0.lon = 8;

$cyl0.lat = 1;

$cyl0.CapStart = 0;

$cyl0.CapEnd = 0;

$cyl0.loc = ($p2.x, $p2.y, $p2.z);

$rx = 0;

if(($p1.x-$p2.x) < 0) { $ang = 180; } else { $ang = 0; }

$ry = $ang + atan(($p1.z-$p2.z)/($p1.x-$p2.x)) * 180.0 / $PI2;

$rz = acos(($p1.y-$p2.y) / $CylLen ) * 180.0 / $PI2;

$cyl[$i].orientation = RPYtoQuaternion($rx, $ry, $rz);

it ALMOST works. The cylinder is positioned not very precise.

23

Hello,

I have two points. I want to connect them not with the line, but with the cylinder. Is this possible ?

I have two points. I want to connect them not with the line, but with the cylinder. Is this possible ?

24

Do you get the same effect with just a simple cylinder? If not, then I'm guessing you've done something weird with this model, and you may want to re-create it.

How did you create that portion of the model in the first place, as two halves? Are you certain you don't have any overlapping or duplicate meshes? Or maybe flipped faces? Are you using two-sided materials?

The process was following:

1. i've done a simple shpere,

2."convert to mesh"

3.switching to point edit mode and removing some points from top and bottom of the sphere

4. used non-uniform scale by axis Y

I'm receiving the same effect everytime when i'm creating a simple cylinder or sphere and after that convert them to mesh

I'm using a one-sided material, the normals are the same (i've exported the model to the orbiter flight simulator - if normals were reverse, there will be seen a hole in place of the reverse normals)

I can send this part of model if needed...

25

Everytime i'm creating a object (cylinder, sphere) there was some problem with object shadow. One half of the object is darker then other, independently of applied material. This stays even in export and i cannot find where the problem is.

My sphere looks ugly, and not like single object (see red arrow where this line comes for example)

Can anyone helps me with that, please?

My sphere looks ugly, and not like single object (see red arrow where this line comes for example)

Can anyone helps me with that, please?

Pages: 1 [**2**]