Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Assembly] Card 1 : JCS are ugly #10745

Closed
2 tasks done
PaddleStroke opened this issue Sep 20, 2023 · 6 comments
Closed
2 tasks done

[Assembly] Card 1 : JCS are ugly #10745

PaddleStroke opened this issue Sep 20, 2023 · 6 comments
Assignees
Labels
WB Assembly Related to the Integrated Assembly Workbench

Comments

@PaddleStroke
Copy link
Contributor

PaddleStroke commented Sep 20, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Following the introduction of #10611 :
The created JCS are fairly ugly.
@qewer33 the mockup you posted seems good to me. Do you want to attempt to implement it in coin or do you want me to jump in ?
Mockup : image

Full version info

0.22 after https://github.com/FreeCAD/FreeCAD/pull/10611

Subproject(s) affected?

Other (specify in description)

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@luzpaz luzpaz added the WB Assembly Related to the Integrated Assembly Workbench label Sep 20, 2023
@qewer33
Copy link
Contributor

qewer33 commented Sep 20, 2023

Following the introduction of #10611 : The created JCS are fairly ugly. @qewer33 the mockup you posted seems good to me. Do you want to attempt to implement it in coin or do you want me to jump in ?

I can give it a shot but I need some pointers. What classes/files do I need to modify, or do I need to create a brand new class? Python or C++?

Also here are new mockups (with a circle alternative) with the plane on the center:

image

@PaddleStroke
Copy link
Contributor Author

It's python.
The coin code is in the JointObject.py ViewProviderJoint class

attach() is the function that creates the coin objects. and assign it to the display mode. In this function you can see :
self.switch_JCS1 = self.JCS_sep(obj, self.transform1)
This is one joint coordinate system. So you can see its made in JCS_sep function
This function creates JCS = coin.SoAnnotation() this is basically the JCS coin object. You can see that the axis get added to this.
The axis themselves are create in the line_sep function.

The line thickness is a property, so it is actually defined in init.
The line lengths are applied by the self.axisScale. So its determined in get_JCS_size. Basically if you want to make them shorter you need to change this line : camera.height.getValue() / 10.
replace 10 by 20 and length will halve.
For the rectangle, you will need to create a soFaceSet (I seem to recall that's the name) And you will want to create it in a similar fashion as the lines are created.

@howie-j
Copy link
Contributor

howie-j commented Sep 20, 2023

The circle one looks nice 💯
It will also help visually to make sure the JCS is placed correctly, e.g in the center of a hole.

@PaddleStroke
Copy link
Contributor Author

Alternate idea. Dunno what its worth.
image

@qewer33
Copy link
Contributor

qewer33 commented Sep 20, 2023

Got something working! I'll also attempt to implement the view scaling for JCS's (#10746) and try to make it a circle somehow (is there like a helper function to calculate vertices from a circle w/ radius or something for SoFaceSet or do I have to write one myself? or use like NURBS node perhaps? or maybe even a really thin cylinder, not sure)

image

@PaddleStroke
Copy link
Contributor Author

Great that's nice !
You can perhaps ask chatgpt he might have some ideals how to draw a circle.
Awesome if you can pick up the scaling as well !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WB Assembly Related to the Integrated Assembly Workbench
Projects
Development

No branches or pull requests

4 participants