Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi~
I want to progamm add-on application of gear hobbing using the CoCreate/SolidDesigner Integration Kit.
But I met some questions about the basic data types in Modeling sofeware environment.
Just like point (gpnt3d or gpnt2d), direction , vector , position , u-vector , gpntwc , etc.
Does anybody could help me to explain them , and what difference between them?
Thanks
Justin
Solved! Go to Solution.
The length of a direction is always 1. (e.g. 1,0,0 or 0,-0.5,0.866)
A vector is essentially a direction and distance. It is expressed as the distance in each of the 3 directions (e.g. 0,10,5 or 1,1,1)
A position is the coordinates in X, Y, and Z, but it can also be thought of as a vector from 0,0,0 to the point.
gpnt3d is the construct for a value with 3 coordinates. This can represent a 3D position (point), a vector, or a direction since all three have 3 values.
gpnt2d is the construct for a value with 2 coordinates. This is normally the 2D coordinates of a point on a workplane.
gpntwc is the construct for when you pick a point in the viewport (if you don't pick on an existing object)
Justin,
gpnt3d is the data structure for a 3D coordinate or vector. This structure can be created from the X, Y, Z values using the make-gpnt3d command and likewise the X, Y, Z values can be read from the gpnt3d structure using the gpnt3d_x, gpnt3d_y and gpnt3d_z commands.
Below is how this might look in lisp code. This is not tested so forgive me if I typed something in wrong (which is highly likely).
(setf coord (make-gpnt3d :X 23.67 :Y 52.69 :Z 75.23)) ; sets variable coord with x=23.67, y=52.69 and z=75.23
(print coord) ; in case you want to see the coord values in the consule window (to help with debugging)
(setf xcoord (gpnt3d_x coord)) ; sets xcoord to the X coordinate of coord
(setf ycoord (gpnt3d_y coord)) ; sets ycoord to the Y coordinate of coord
(setf zcoord (gpnt3d_z coord)) ; sets zcoord to the Z coordinate of coord
As applied to vectors, the X value is the magnitude in the X direction, etc.
Hopefully this gets you headed in the right direction.
Scott
Thanks to Scott for you explanation !
The length of a direction is always 1. (e.g. 1,0,0 or 0,-0.5,0.866)
A vector is essentially a direction and distance. It is expressed as the distance in each of the 3 directions (e.g. 0,10,5 or 1,1,1)
A position is the coordinates in X, Y, and Z, but it can also be thought of as a vector from 0,0,0 to the point.
gpnt3d is the construct for a value with 3 coordinates. This can represent a 3D position (point), a vector, or a direction since all three have 3 values.
gpnt2d is the construct for a value with 2 coordinates. This is normally the 2D coordinates of a point on a workplane.
gpntwc is the construct for when you pick a point in the viewport (if you don't pick on an existing object)
Thanks to Peter for your explanation !
Is the world coordinate (gptwc) dynamic or static in the viewport?
Thanks to Pete and Scott, the basics of points, vectors etc. have been explained.
My question is: Do you have a IKIT license?
While you can start prototyping in "interpreted LISP", the usual way to develop an add-on application is:
- Develop and test LISP Code
- Finally, use the LISP Compiler to create a DLL (to protect your development)
Our customized LISP code is not compiled. We use the commands from the Integration Tool Kit to write customization LISP code but we do not have the developer's kit (IKIT) license.
Scott