simos421 / CST-MATLAB-API

CST-MATLAB-API
GNU General Public License v3.0
212 stars 60 forks source link

Help wanted - Transform code in MATLAB #23

Closed Nerdynath closed 10 months ago

Nerdynath commented 11 months ago

I am wanting to create a transform function. How do I begin to code for this?

I have a cylinder which I want to duplicate 8 times (9 cylinders total) via the transform function due to the ability of uniting the cylinders. I have created my first cylinder in the top right corner of my design and the design is centred on x,y,z = 0.

I want to transform the cylinder twice.

The first transform will be copying and uniting the cylinders twice in the negative x direction (this would be three cylinders total. One in the initial position and then the two added ones)

The second transform would be done on the previous transform. Transforming the three cylinders in -y direction twice (this would be a total of 9 cylinders, 3 for each duplication and then 3 from the original transformation).

How would this be done? Remember I want to copy and unite them so all 9 cylinders count as a single object.

simos421 commented 11 months ago

Hello Nerdynath,

I am not sure if your question is CST-MATLAB-API code related or just a CST problem, if it's the second, better see a youtube tutorial. For the first, do this:

1) first design what you want in CST, without using matlab 2) then, if you open the history log of CST you will see that it records everything you did in visual basic script 3) Now you need to interface this script with matlab. So open one of my functions (e.g. anything in the home folder of the api) and see how I translate tha visual basic script into a matlab function. I use the invoke function in matlab to do the visual basic to matlab translation. It might look intimidating but it is very easy. Mostly just copy-paste

Br Simos

On Wed, 6 Dec 2023 at 19:04, Nerdynath @.***> wrote:

I am wanting to create a transform function. How do I begin to code for this?

I have a cylinder which I want to duplicate 8 times (9 cylinders total) via the transform function due to the ability of uniting the cylinders. I have created my first cylinder in the top right corner of my design and the design is centred on x,y,z = 0.

I want to transform the cylinder twice.

The first transform will be copying and uniting the cylinders twice in the negative x direction (this would be three cylinders total. One in the initial position and then the two added ones)

The second transform would be done on the previous transform. Transforming the three cylinders in -y direction twice (this would be a total of 9 cylinders, 3 for each duplication and then 3 from the original transformation).

How would this be done? Remember I want to copy and unite them so all 9 cylinders count as a single object.

-

[ ]

#

— Reply to this email directly, view it on GitHub https://github.com/simos421/CST-MATLAB-API/issues/23, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJAISOKZ5KV7E2JQWYU7ECDYICQS7AVCNFSM6AAAAABAJWTFWWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDSMBQGY4TGNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>