Points 3D measure unit seems to be cm

Points 3D measure unit seems to be cm

Anonymous
791 Views
7 Replies
Message 1 of 8

Points 3D measure unit seems to be cm

Anonymous
Not applicable

In these days I'm posting a lot of questions, but I'm learning... Anyway I always try to find previous related questions and I check the documentation.

I'm trying to understand how to draw lines, points and spline in a sketch and I found this example which I "cut" just after line 30. So this is my last line:

 

spline = sketch.sketchCurves.sketchFittedSplines.add(points)

 

 I'm wondering why these points are considered as they were in cm, as the result I get is this one:

lucabortolotti1984_0-1617124332110.png

And the selected point was the second one, this in the code:

 

points.add(adsk.core.Point3D.create(5, 1, 0))

 

Next step I tried was divide by 10, and I got the expected result. I suppose it works in cm, but I didn't find any reference in the documentation.

 

Then I tried to draw the spline in sketches based on different Reference planes; instead of

 

sketch = rootComp.sketches.add(rootComp.xYConstructionPlane)

 

I tried

 

sketch = rootComp.sketches.add(rootComp.xZConstructionPlane)

 

and

 

sketch = rootComp.sketches.add(rootComp.yZConstructionPlane)

 

Ok, in both these case I completely didn't understand the result and I can't figure out how does it work.

Any suggestions?

 

Thanks

Luca

 

 

0 Likes
Accepted solutions (3)
792 Views
7 Replies
Replies (7)
Message 2 of 8

nnikbin
Collaborator
Collaborator
Accepted solution

According to Understanding Units in Fusion 360:

 

If you call the SketchCurve.length property to get the length of an entity in a sketch, the value returned will always be in centimeters.

 

The length passed in is always expected to be in database units (centimeters)

0 Likes
Message 3 of 8

Anonymous
Not applicable
That's super useful, thanks!
Do you have any guess for the second part of my post?

Thanks again!
0 Likes
Message 4 of 8

BrianEkins
Mentor
Mentor
Accepted solution

Regarding your second question, each sketch has its own coordinate system.  When you draw sketch geometry, the coordinates are relative to the sketch coordinate system.  If you create a sketch on the XY construction plane, that coordinate of that sketch will align with the world coordinate system.  Sketches created on the other two base construction planes will have their origin at world (0,0,0) but their axes will be oriented differently.  If you create a sketch on the base YZ plane, the X-axis of the sketch is in the world negative Z direction, the Y is in the positive Y direction and the Z is in the positive X direction.  The coordinate system of a sketch created on another construction plane or face can be in any orientation and position.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 5 of 8

nnikbin
Collaborator
Collaborator
Accepted solution

When you use Point3D objects in SketchFittedSplines.add method, the points are considered to be in sketch space (not world space/model space).

 

If you have a Point3D object in model space you can use Sketch.modelToSketchSpace Method to find the equivalent point in sketch space. Similarly if you have a Point3D object in sketch space you can use Sketch.sketchToModelSpace Method to find the equivalent point in model space.

 

Also the sketch orientation may be somehow confusiong. I suggest reading this post by @apocalip, specially @BrianEkins  answer to that post.

0 Likes
Message 6 of 8

nnikbin
Collaborator
Collaborator

Sorry, when I posted I did not nitice that @BrianEkins  has answered your question.

0 Likes
Message 7 of 8

Anonymous
Not applicable
Thanks, perfectly to the point, to stay in topic 😉
0 Likes
Message 8 of 8

Anonymous
Not applicable
Thanks for the reply, it is useful also after the great reply of @BrianEkins, because it adds the information about conversion between spaces! I was already thinking about how to apply matrix rotations or switch to quaternions... You saved my day!
0 Likes