I'm thinking about to build a web feature (I mean a web as a skeleton). The aim is to move lines depending themselves. Selecting and moves must be do on the 3D display for easier use. For example is to change positions of a dummy. (positions will can be saved).
But I'm not gift to write that. And I don't know anything about coin3D programming.
How to tackle my project? any help?
A web feature
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
A web feature
- Attachments
-
- Capture.JPG (20.75 KiB) Viewed 959 times
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: A web feature
How about make a modeless dialog that stays on top instead of dragging in the 3D view? This seems easier for the coder and perhaps also for the user because dragging in the 3D view is very challenging. You need a working plane always when translating 2D x,y mouse movements to 3D x,y,z coordinates. This is very confusing and not very intuitive, IMO. My idea is to have Part::Vertex objects to be manipulated. The lines connecting them would automatically update on recompute to reconfigure themselves.
In Curves a Line object is available that makes a line between two vertices. Create Part::Vertex objects and lines between them such that when a vertex moves the line moves with it. No need for Coin or fancy mouse observers. Have a button for each direction. Maybe label them up, down, left, right, forward, backward. Maybe click moves 1mm, Alt+Click 100mm, Shift+Click 10mm, Ctrl+Click 0.1mm. The Line objects can be made non-selectable in the view tab or by manipulating the view object in python. That way only the vertices can be selected by the user.
FreeCAD's dragger tool could also be used to manipulate an individual vertex's position. Maybe have a drag button to activate it on the selected vertex. This would enable some dragging in the 3D view (but rotating a vertex does not have much effect unless something is attached to it). Select the object and run the command to bring up the dragger:
This might eliminate need for the modeless dialog. You can set the point size to some large value / change color to make them easier to see and drag by changing it in the view object. E.g. App.ActiveDocument.getObject("Vertex").ViewObject.PointSize = 6.
For the puppet being manipulated perhaps attachments could be used with attachment offset off to the left.
The sketcher cannot work in 3D, but you could use it to make a 2D version of the skeleton perhaps where all the limbs are in the same plane. Add a sketcher point object constrained coincidentally to each place you want a part::vertex. Create one Part::Vertex and use Draft Point array to make the array of Part::Vertex objects. Part::Explode compound on the array to get at the individual objects.
In Curves a Line object is available that makes a line between two vertices. Create Part::Vertex objects and lines between them such that when a vertex moves the line moves with it. No need for Coin or fancy mouse observers. Have a button for each direction. Maybe label them up, down, left, right, forward, backward. Maybe click moves 1mm, Alt+Click 100mm, Shift+Click 10mm, Ctrl+Click 0.1mm. The Line objects can be made non-selectable in the view tab or by manipulating the view object in python. That way only the vertices can be selected by the user.
FreeCAD's dragger tool could also be used to manipulate an individual vertex's position. Maybe have a drag button to activate it on the selected vertex. This would enable some dragging in the 3D view (but rotating a vertex does not have much effect unless something is attached to it). Select the object and run the command to bring up the dragger:
Code: Select all
Gui.Selection.clearSelection()
Gui.Selection.addSelection(App.ActiveDocument.Name,"Vertex")
Gui.runCommand("Std_TransformManip",0)
For the puppet being manipulated perhaps attachments could be used with attachment offset off to the left.
The sketcher cannot work in 3D, but you could use it to make a 2D version of the skeleton perhaps where all the limbs are in the same plane. Add a sketcher point object constrained coincidentally to each place you want a part::vertex. Create one Part::Vertex and use Draft Point array to make the array of Part::Vertex objects. Part::Explode compound on the array to get at the individual objects.
- Attachments
-
- skeleton.FCStd
- (19.13 KiB) Downloaded 33 times