ParallelGraphics Forums
Authoring Tools
You are here: [Forums]::[Authoring Tools]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
  Authoring Tools

Subject: create cylinder form indexed faceset
Sender: arjo.rozendaal@xs4all.nl 25.03.06 13:05

Hi,

My 3D package does save cubes as geometry box. This is how I want it. It also saves spheres correctly. Only one thing goes wrong. A cylinder is saved as an indexed faceset.
Now I want to recreate the geometry cylinder.

The thing I do now is naming every cylinder I create by it's radius and height. A name like cyl_r1p5_h5 describes a cylinder with radius 1.5 and height 5. This way I can see what the size of the cylinder should be within VRML Pad.

Next step I select the geometry Indexed Faceset with it's values within the curly brackets. When this section is selected I run the following script from the menu and fill out the right values in the inputbox:

Sub Cylinder
Set doc = Window.Documents.Active
rr = InputBox("Enter Radius:","Create Tube","1")
If rr = "" Then Exit Sub
On Error Resume Next
hh = InputBox("Enter Height:","Create Tube","5")
If hh = "" Then Exit Sub
rr = Replace(rr, ",", ".")
hh = Replace(hh, ",", ".")
nodestring = nodestring + "geometry Cylinder {" + vbCrLf
nodestring = nodestring + "    radius " + rr + vbCrLf
nodestring = nodestring + "    height " + hh + vbCrLf
nodestring = nodestring + "}" + vbCrLf
doc.Selection = nodestring
doc.Saved = False
End Sub

I did not write this script myself but clipped it out of the sample scripts I found in this forum.
When there's a single cylinder this is not much work. But when there are many cylinders it's becoming a tedious task.

So my question is: How can I create a script that finds the specific names and automaticallly uses the radius and height provided within the name to replace the "geometry IndexedFaceset" with "geometry cylinder".
I tried a few things but had no luck at all.

Arjo.

 


create cylinder form indexed faceset / arjo.rozendaal@xs4all.nl / 25.03.06 13:05

Messages in thread: 1


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.