Separate Component from world_coords
See original GitHub issueShould parts have a separate class instance for its world presence?
Current Implementation
>>> from cqparts_misc.basic.primatives import Cube
>>> from cqparts.utils import CoordSystem
>>> cube = Cube()
>>> cube.local_obj # geometry in the part's native coordinate system
>>> cube.world_coords = CoordSystem((1, 2, 3))
>>> cube.world_obj # geometry translated by (1, 2, 3)
Potentially changed to
>>> from cqparts_misc.basic.primatives import Cube
>>> from cqparts.utils import CoordSystem
>>> from cqparts import WorldPart
>>> cube = Cube()
>>> cube.obj # geometry in the part's native coordinate system
>>> world_cube = WorldPart(cube)
>>> world_cube.coord_sys = CoordSystem((1, 2, 3))
>>> world_cube.obj # geometry translated by (1, 2, 3)
As suggested by @gntech @zwn in https://github.com/fragmuffin/cqparts/issues/97#issuecomment-394616079
Issue Analytics
- State:
- Created 5 years ago
- Comments:25 (23 by maintainers)
Top Results From Across the Web
[MEL] How to get a component pivot world coords?
Hi! Is it possible to get a component pivot world coordinates ( position and rotation) , using MEL?
Read more >2.1 World Coordinates Support - ESO archive - Eso.org
The world coordinates support in this library based in part on Doug Mink's ... Another class, called WorldCoords , is not based on...
Read more >javascript - Converting World coordinates to Screen ...
Try with this: var width = 640, height = 480; var widthHalf = width / 2, heightHalf = height / 2; var vector...
Read more >Coordinates Expressions
The TextureCoordinate expression outputs UV texture coordinates in the form of a two-channel vector value allowing materials to use different UV channels, ...
Read more >Lecture 12: Camera Projection
Avoid confusion: Pw and Pc are not two different points. They are the same physical point, ... in two different coordinate systems. ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well, I am thinking about a system where the actual position and orientation of Parts is completely external to them. In such a system the pose of a Part would only be part of its containing Assembly and it would be based on CoordinateSystem of the containing Assembly. Such an Assembly could itself be easily placed within another Assembly just as Part can be. The top level Assembly CoordinateSystem would be the world coordinates. Actually just like a scene graph.
@zignig
yeah!, I think these calculations would be less fiddly. But only if we have a clean and intuitive way of getting
CoordSystem
instances from solved assemblies.It would also make exploding a simpler process… one way to do it would be to recursively offset assemblies and parts by a factor along their local
Z
axis. It would look cool! and I think that’s important…cadquery
andcqparts
as tools are still being adopted by the larger community, and visual appeal is a big part of that.