-
How can I calculate the relative circumference of the points of a profile or airfoil? |
Beta Was this translation helpful? Give feedback.
Answered by
MarAlder
Nov 2, 2021
Replies: 1 comment 6 replies
-
You have a CPACS file with guide curves, I guess? Then I suggest to use TiGL's configuration manager API. The following example provides the guide curve points of the simpleAircraft.xml example: from tixi3 import tixi3wrapper
from tigl3 import tigl3wrapper
import tigl3.configuration
import numpy as np
# Instantiate TiXI
tixi_h = tixi3wrapper.Tixi3()
# Open the XML file
fname = 'simpleAircraft.xml'
error = tixi_h.open(fname)
if not error:
print('CPACS data set %s opended successfully.'%fname)
tigl_h = tigl3wrapper.Tigl3()
tigl_h.open(tixi_h,'aircraftModel')
# Load config manager
mgr = tigl3.configuration.CCPACSConfigurationManager_get_instance()
aircraft_config = mgr.get_configuration(tigl_h._handle.value)
# Fuselage; replace "get_fuselage(1)" with "get_wing(2)" to geht the vertical tailplane with guide curves from the given example
fuselage = aircraft_config.get_fuselage(1)
gc_points = fuselage.get_guide_curve_points()
gc_coords = np.zeros([len(gc_points),3])
for i,pnt in enumerate(gc_points):
gc_coords[i] = pnt.Coord()
gc_wires = fuselage.get_guide_curve_wires() # If you would like to do further CAD operations, this might be a good starting point |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
MarAlder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have a CPACS file with guide curves, I guess? Then I suggest to use TiGL's configuration manager API.
The following example provides the guide curve points of the simpleAircraft.xml example: