mariwanj / design456 Goto Github PK
View Code? Open in Web Editor NEWAn attempt to create Direct Modeling workbench for FreeCAD
License: GNU General Public License v3.0
An attempt to create Direct Modeling workbench for FreeCAD
License: GNU General Public License v3.0
For most widgets, The position and the rotation is not totally correct.
This affect the DirectScale, SmartScale, the fr_arrow_widget .. etc
I need to study this to figure out how I fix the issues I have.
Still coin is the biggest problem.
13:00:50 'Design456_Extrude' getArrowPosition-Failed. 'Part.Shell' object has no attribute 'Surface'
13:00:50 'draw_arrow' Failed. 'NoneType' object is not subscriptable
13:00:50 Running the Python command 'Design456_SmartExtrude' failed, try to resume
Subtracting or Combining 2 2-D faces move the result to a grid position that is the addition of X and Y from the two faces.
Example: A square at X20, Y10, Z5 and a Circle at X22, Y5, Z5, when combining will result the combined object to move to X42, Y15, Z5.
Also, if after the subtracting or combining, you press Ctrl-Z to cancel the operation, it cancel, but one of the faces becomes extruded.
It is very important point that the feature "3D Snap" is still missing in FreeCAD...if it becomes, reference line among 3D objects for a Datum Plane becomes very easy ...and more...
@yorikvanhavre @luzpaz @realthunder @Rentlau @wwmayer @abdullahtahiriyo
in my opinion, you should also think of a improving a new command "bending an existing model" like the following one ,which is still a missing point in FreeCAD
https://youtu.be/g6iC0Tc1Ydw
21:54:26 No module named 'polyhedrons'
21:54:26 Traceback (most recent call last):
File "", line 55, in Initialize
File "C:\FreeCad19A\Mod\Design456\Design456_Part.py", line 48, in
class Design456_Part:
File "C:\FreeCad19A\Mod\Design456\Design456_Part.py", line 49, in Design456_Part
import polyhedrons
21:55:39 module 'FreeCAD' has no attribute 'DraftWorkingPlane'Error: Draft activation failed, Draft will not work as expected
EDIT:
Found the problem, the ZIP file for download the Design456 doesn't not pack the Pyramid files... needed to download it apart and copy into the MOD folder.
Fails when it is a 2d face .. must be debugged to find out when and why
Some recommendations for code styling:
https://wiki.freecadweb.org/Python
The wheel is not working well.
Create a cube, click "Move Detail", a Transform window opens on Combo View, on Rotation, you can input any number in the "Around n-axis", click "Apply", the number returns to zero and the part doesn't rotate.
What happens is: The "Rotation" pull down menu starts with "Rotation axis with angle" and followed by three number entires, for each angle, but those entries are for the "Euler angles (x y'z"), this is why it is not working. I need to click the pull-down menu and selecte Euler angles, and back to "Rotation axis with angle" so it then shows only two entries, Axis and Angle, then it works.
Once in "Rotation axis with angle" it is expecting numbers on those entries (axis and angle), but the Euler entires is presented, so changing values on X, Y or Z entries will mean nothing to "Rotation axis with angle", then it does nothing to the object.
I think it is just an unmatch between the selection preset on the pulldown menu and the variables input selection. Easy to fix.
Paint dos not take the correct placement. It refers to App.Vector(0,0,0) always.
this is not correct.
It needs also a new feature to project a sketch on a surface.
Due to the placement problem in FreeCAD, smart alignment fails for some object.
This tool needs a better thought for overcome the problem.
At the moment, I have no good way to fix the issue.
https://github.com/easyw/Defeaturing_WB
https://wiki.freecadweb.org/Defeaturing_Workbench
Maybe there is functionality you can use in there for Design456 ?
Not always that angle is correct for the arrows.
Find a way to make the drawing of the arrows at a better position when user select lower edge of the object.
Use Part.makePolygon .. Don't use Draft.makeWire.
Due to the order of the vectors , the joining process might fail. tool must be re-written
For example, clicking on a face and being able to extrude by moving the mouse, instead of specifying a the distance by entering a number in to a text field.
- https://github.com/MariwanJ/Design456/blob/731f48af/README.md?plain=1#L6-L8
Further, i will say that if the "interactive" part is requiring more work, then you can very well focus on just the "direct modelling" part for now... that way,
this wil also help for interactive widget too as later
Selecting loop-faces, loop-edges fails.
if the faces are perpendicular to XY plane the tool works. But when the faces are perpendicular to ZY or ZX the tool fails.
Similar to Assembly4 is it possible to link external models? I'm looking to simply pick and place models on the plane as a quick way to visualize how things come together.
Thanks :)
After any event (dragging) the discs appears again even if they should be disabled.
This is due to the enableall funciton that is used after release or double click.
Affects now the EdgeExtend tool.
Rotation of the disc is totally wrong and it varies based on the face location.
This causes a slow extrusion due to the thousands of calls during extrusion.
Let SmartExtrude extrude 0.5 mm each time.
I see that when the object is a compound object, it causes different kind of problem for many tools I have.
NormalAt, face direction, extraction ..etc.
Investigation must be done to overcome this problem.
When you draw a2D Drawing and you extrude that with the tool while you choose "Subtract", A Fusion object creates while it shouldn't.
User can delete that but it is confusing.
This was supposed to be fixed but it still there. There are cases where that appears again.
Line 64 might fail if a surface doesn't have Rotation. Often compound, fusion ..etc might be so.
It fails to calculate the correct vector.
Again normal extrude fails due to Part.Compound property which is missing the normalAt
Using DirectScale let you know that the redrawing is not good.
I need to find out how to fix that issue. It will affect all tools I am implementing negatively if not fixed.
@luzpaz @carlopav @joelgraff
Please look at the devbranch - main has not the updates yet.
For the widget system I am preparing, I let the user write the callback for the mouse events later by sub-classing the widgets.
But when I subclass the line_widget in the smartscale, the callback is still the parents callback. There is no reason to be like that as I am overriding the variable.
If it was cpp, it shouldn't happen but in python either I don't know or it is not easy to implement.
I would appreciate any help in understanding or fixing this issue. Thank you very much in advance.
look at this part.
def lblcallback(userData=None):
"""
This function will run the label-changed
event callback.
"""
#TODO : Subclass this and impalement the callback
# to get the desired effect
print("dummy line-widget-label callback")
def callback(userData=None):
"""
This function will run the when the line is clicked
event callback.
"""
#TODO : Subclass this and impalement the callback
# to get the desired effect
print("dummy line-widget callback" )
class Fr_Line_Widget(fr_widget.Fr_Widget):
"""
This class is for drawing a line in coin3D world
"""
def __init__(self, vectors: List[App.Vector] = [], label: str = "", lineWidth=1):
self.w_lineWidth = lineWidth # Default line width
self.w_widgetType = constant.FR_WidgetType.FR_EDGE
self.w_callback_=callback #External function <---- this is not overriding the function
self.w_lbl_calback_=lblcallback #External function <---- this is not overriding the function
self.w_KB_callback_=KBcallback #External function
self.w_move_callback_=movecallback #External function
super().__init__(vectors, label)
They generate tons of errors. Don't know why.
Inkscape must be the problem.
Any solution??
Don't recreate faces that are not affected by the movement of the edge. And the faces that share only one vertex needs to be divided in to two triangles,
When you extract for subtraction, the tool affect invisible objects.
Some surfaces needs 'Custom' others 'Normal'
I still didn't figure out why and when?
@carlopav
1-The face it takes to modify is not what you click. This should be fixed.
2-Trying to re-use the tool on the same face it affect the old object. It shouldn't be like that.
3- I think the new object should be merged and fined to make them as one part.
Look at the picture.
Created a cube, used the "divide object in two parts". It deleted the "cube" from the list and created a "SplitedObject" in the tree list. In 3d screen I can see the same cube with a dividing line in the axis I selected. But I can't move the slices individually, they still connected as a single object, and a message is posted:
10:23:33 ViewProviderExt.cpp(1340): Cannot copute Inventor representation for the shape of Unnamed#Compound
This command should not create two objects from the original one, sliced on the division line?
Needs investigation and test
Using smartExtrude causes that the objects are either disappearing or the opacity is not correct.
It always starts from the end of the edge and continue adding to the line. This is tool is not attended to work like that.
needs a fix
Some debugging must be done. It fails at different usages.
Create a cube 10x10x10mm, select one edge and filet 1mm, select a connected edge and filet 1mm, it end up with 3 fileted edges. It filet an extra edge without selecting it. This problem does not happen with Chanfers.
In the following Part Prism, I just requested filets on bottom left, then bottom right, the vertical was produced without requesting, and it has narrow.
The slowness of OCC affect the direct Scale and it is kinda hard to use.
Recreating the object needs to be moved to COIN3D.
Sometimes due to Unknown reason , the arrow is facing a wrong direction. Not always happen but I can see it sometimes happening.
Need investigation
For several reasons, SmartAlignment .
needs to be tested to find out the problems.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.