-
-
February 26, 2025 at 2:45 pm
sjorskremer
SubscriberHi,
Does anybody know whether it is possible to create a spline or bsplin through more than 6 keypoints?
Say i want to make a spline through 12 keypoints. I can make 2 splines, each through 6 keypoints. However, the 2 splines won't align that well at the intersection. In: SPLINE,Â
P1
,ÂP2
,ÂP3
,ÂP4
,ÂP5
,ÂP6
,ÂXV1
,ÂYV1
,ÂZV1
,ÂXV6
,ÂYV6
,ÂZV6
you can define the slope vector, which theoretically means you could align the 2 splines by defining (aligning) the slope vectors. Does anybody know how to retreive the slope vectors from the endpoint of a spline? (I am using PyMAPDL)Many thanks!
-
February 27, 2025 at 3:34 pm
mrife
Ansys EmployeeHi sjorskremer
It's posible by picking the keypoints; the trick is that picking does not have to be an human + MAPDL UI interactive operation. You can replicate picking by two commands, then issue the spline command with P51x as the first keypoint (indicating to take the last picking list).
Manually creating a picking list requires the use of 2 APDL commands. The first is FLST; see it's help here:
https://ansyshelp.ansys.com/public/account/secured?returnurl=/Views/Secured/corp/v251/en/ans_cmd/Hlp_C_FLST.html
The other is FITEM; you navigate to it from the help on FLST (the Notes discussion are the bottome of the help page has the link to the FITEM command).
Then try the command style in MAPDL interactive and review the log file. To get you started here are the commands to create a spline through 3 keypoints (KPs 1, 2, 3):
FLST,2,3,3
FITEM,2,1
FITEM,2,2
FITEM,2,3
SPLINE,P51X
Once you get the hang of this, then getting the list of KPs and looping through them to issue the fitem command in PyMAPDL is pretty straight forward. You could wrap it in a function definition if you need to use the logic often.
MikeÂ
-
March 10, 2025 at 10:18 am
sjorskremer
SubscriberMuch appreciated! I notice that this does not work for the BSPLIN command, is that right and is there a method for this command as well?Â
-
March 10, 2025 at 2:22 pm
mrife
Ansys EmployeeWhat version are you using and what happens when you try the method with bsplin?
-
March 11, 2025 at 9:36 am
sjorskremer
Subscriberansys.mapdl.core version: 0.68.4
MAPDL Version: 24.1
I have the following code:
mapdl.finish()
mapdl.clear()
mapdl.prep7()a = 6*np.pi
n = 20
x = np.linspace(0, a, n)
z = np.sin(x)for i in range((n)):
  mapdl.k(i+1, x[i], 0, z[i])mapdl.flst(2, n, 3)
for i in range(n):
  mapdl.fitem(2, i+1)mapdl.spline('P51X')
# mapdl.bsplin('P51X')
  Â
print(mapdl.llist())
mapdl.lplot()the mapdl.spline command gives back 19 lines (which is expected)
the mapdl.bspline command give back only 1 line, between keypoints 1 and 2
-
March 11, 2025 at 3:30 pm
mrife
Ansys EmployeeMAPDL quirk, the P51X goes in the second field in the bsplin command. So try mapdl.bsplin(' ', 'P51X')
-
March 13, 2025 at 7:47 am
-
March 13, 2025 at 2:35 pm
mrife
Ansys EmployeePlease follow the instructions in the error message and post this to the PyMAPDL GitHub Issues site here:Â
https://github.com/ansys/pymapdl/issues
-
- You must be logged in to reply to this topic.
-
2803
-
965
-
851
-
599
-
591
© 2025 Copyright ANSYS, Inc. All rights reserved.