Commit Graph

168 Commits

Author SHA1 Message Date
paul
f29131bbae [ArchWall] getExtrusionData() fix normal problem by adding get_shape_normal() (#12603)
* [ArchWall] getExtrusionData() fix normal problem by adding get_shape_normal()

In geometry.py
- added get_shape_normal()
- fixed is_straight_line()
DraftGeomUtils.py
- added get_shape_normal()

FC Discussion - https://forum.freecad.org/viewtopic.php?p=726101#p726101

* [ArchWall] getExtrusionData() fix normal problem

Follow-up following discussion at https://github.com/FreeCAD/FreeCAD/pull/12603

- delete trailing whitespaces
- put Part.makePolygon() in try statement
- study and findings at https://github.com/FreeCAD/FreeCAD/pull/12603#issuecomment-1969277743

In geometry.py
- added get_shape_normal()
- fixed is_straight_line()
DraftGeomUtils.py
- added get_shape_normal()

FC Discussion - https://forum.freecad.org/viewtopic.php?p=726101#p726101

* Update geometry.py

* Update geometry.py

* Update geometry.py

---------

Co-authored-by: Yorik van Havre <yorik@uncreated.net>
2024-04-02 11:54:27 +02:00
Roy-043
59753260c9 Draft: implement new get_param functions (step 1)
See #11677
2023-12-11 19:31:34 +01:00
Roy-043
8032698676 Draft: Add distance_to_plane and project_point_on_plane to geometry.py
The functions have been copied from the WorkingPlane class. It makes sense to also have them available outside that class. The WorkingPlane class will later be updated to use these functions so that duplicate code is avoided.

Note that the default tolerance of the project_point_on_plane function is 1e-7. In the original projectPoint function it is sys.float_info.epsilon (too small for FreeCAD IMO).
2023-09-19 16:02:59 +02:00
Roy-043
9fde9f53fa Draft: Fix Draft_Mirror preview 2023-08-29 16:25:42 +02:00
Roy-043
bfa8d79afb Draft: Add placement_from_face to geometry.py (#10327)
Changed getPlacementFromFace function in WorkingPlane.py to a compatibility function that calls placement_from_face.
2023-08-23 12:05:34 +02:00
Roy-043
649dde9808 Draft: Add placement_from_points to geometry.py
Changed getPlacementFromPoints function in WorkingPlane.py to a compatibility function that calls placement_from_points.
2023-08-23 11:17:17 +02:00
luzpaz
38a01939e0 Migrate domain name from freecadweb to freecad (#9352)
* Migrate domain name from freecadweb to freecad
* Migrate src/Mod/Material files
* Migrate Stylesheet related files
* Migrate *.svg files
* Migrate miscellaneous files
* Migrate some build files
* Migrate recently added TD AR_IRAM template files

Closes #6415
2023-04-24 15:19:20 -05:00
Yorik van Havre
6189aee357 Merge branch 'master' into alafr-arch-structure 2021-03-26 11:08:01 +01:00
marioalexis
a11b457121 Draft: Some fixes in upgrade function. bug #0004460, fixes #0004462, #0004080 2020-11-24 22:08:06 -03:00
alafr
bac868a298 Draft: Add geometry functions for Arch Structure
* get_referenced_edges(property_value): returns the Edges referenced by the value of a App:PropertyLink, App::PropertyLinkSub or App::PropertyLinkSubList property.
* get_placement_perpendicular_to_wire(wire): returns the placement whose base is the wire's first vertex and it's z axis aligned to the wire's tangent.
* get_extended_wire(wire, offset_start, offset_end): returns a wire trimmed (negative offset) or extended (positive offset) at its first vertex, last vertex or both ends. For example:
            get_extended_wire(wire, -100.0, 0.0) -> returns a copy of the wire with its first 100 mm removed
            get_extended_wire(wire, 0.0, 100.0) -> returns a copy of the wire extended by 100 mm after it's last vertex
2020-10-31 14:16:50 +01:00
marioalexis
1aa371a819 Draft: Fix logical error in is_line function 2020-10-22 17:14:46 +02:00
marioalexis
1ad7b9788b Improve make_sketch and geometric related functions 2020-10-19 13:15:14 +02:00
vocx-fc
9c9e59fb07 Draft: clean up the order of the submodules in DraftGeomUtils
Import the modules inside `DraftGeomUtils.py` in increasing order
of complexity. For example, the basic module is `general`,
and `geometry`, `edges`, `faces`, `arcs`, and `cuboids`
after it.

On the other hand the `circles_apollonius` module requires
various of those dependencies, so we import it at the end.

We don't import any of the `circles_incomplete` functions
because these are incomplete and we need to implement
the dependency functions first.
2020-06-09 11:51:17 +02:00
vocx-fc
aba904f1e2 Draft: move more functions to draftgeoutils.general 2020-06-05 13:15:31 +02:00
vocx-fc
0e82ae26cd Draft: move functions to draftgeoutils.circles_incomplete 2020-06-05 13:15:31 +02:00
vocx-fc
4dc6b975db Draft: move functions to draftgeoutils.circle_inversion 2020-06-05 13:15:31 +02:00
vocx-fc
1ea5b19ea4 Draft: move functions to draftgeoutils.circles_apollonius 2020-06-05 13:15:31 +02:00
vocx-fc
7f9e6ba16b Draft: move more functions to draftgeoutils.circles, part 2 2020-06-05 13:15:31 +02:00
vocx-fc
4c4531a5fd Draft: move functions to draftgeoutils.circles, part 1 2020-06-05 13:15:31 +02:00
vocx-fc
b6adbe98e4 Draft: move more functions to draftgeoutils.arcs 2020-06-05 13:15:31 +02:00
vocx-fc
c6bac1e58e Draft: move functions to draftgeoutils.cuboids 2020-06-03 15:22:09 +02:00
vocx-fc
3a572d50ca Draft: move more functions to draftgeoutils.faces 2020-06-03 15:22:09 +02:00
vocx-fc
5e25517c37 Draft: move more functions to draftgeoutils.intersections 2020-06-03 15:22:09 +02:00
vocx-fc
ae9850175a Draft: move more functions to draftgeoutils.geometry 2020-06-03 15:22:09 +02:00
vocx-fc
5622da6b90 Draft: move more functions to draftgeoutils.wires 2020-06-03 15:22:09 +02:00
vocx-fc
910ce96aed Draft: move more functions to draftgeoutils.edges 2020-06-03 15:22:09 +02:00
vocx-fc
538327995d Draft: move more functions to draftgeoutils.general 2020-06-03 15:22:09 +02:00
vocx-fc
d8f770989c Draft: move functions to draftgeoutils.linear_algebra 2020-05-29 13:31:28 +02:00
vocx-fc
2f41eaaf27 Draft: move functions to draftgeoutils.offsets 2020-05-29 13:31:28 +02:00
vocx-fc
851f6c02df Draft: move functions to draftgeoutils.fillets 2020-05-29 13:31:28 +02:00
vocx-fc
09daf7cfa1 Draft: move functions to draftgeoutils.arcs 2020-05-29 13:31:28 +02:00
vocx-fc
5637c0fc12 Draft: move functions to draftgeoutils.wires 2020-05-29 13:31:28 +02:00
vocx-fc
9e50eb4785 Draft: move functions to draftgeoutils.geometry 2020-05-25 13:35:34 +02:00
vocx-fc
c10b006955 Draft: move functions to draftgeoutils.faces 2020-05-25 13:35:34 +02:00
vocx-fc
e1c371281b Draft: move functions to draftgeoutils.sort_edges 2020-05-25 13:35:34 +02:00
vocx-fc
15324a8e72 Draft: move functions to draftgeoutils.intersections 2020-05-25 13:35:34 +02:00
vocx-fc
d1405c9b11 Draft: move functions to draftgeoutils.edges 2020-05-25 13:35:34 +02:00
vocx-fc
378f1583fe Draft: move general functions to draftgeoutils.general
New package for organizing the geometrical utility functions of
the workbench, `draftgeoutils`.

The first submodule is one that deals with general operations.
2020-05-25 13:35:34 +02:00
wandererfan
a697c838fc [Draft]Additional modes for PathArray 2020-05-23 11:22:14 -04:00
Yorik van Havre
70962447bc Draft: Small bugfix in DraftGeomUtils.getNormal 2020-04-29 11:43:00 +02:00
Yorik van Havre
1ecde67d8b Arch: [WIP] Curtain Wall tool 2020-04-29 11:43:00 +02:00
luz.paz
1319bfe11c LGTM: Fix 'testing equality to None'
Testing whether an object is `None` using the `==` operator is inefficient and potentially incorrect.
2020-04-22 12:18:33 +02:00
Yorik van Havre
0ea99fd22e Draft: Fixed div by zero error in snapping 2020-04-14 16:01:29 +02:00
wandererfan
093b6d9901 [Draft]support BSplineCurve in getNormal 2020-04-10 12:52:52 -04:00
vocx-fc
173f509349 Draft: DraftGeomUtils clean up docstrings and spaces 2020-04-07 18:12:06 +02:00
vocx-fc
95b8b6ebc4 Draft: DraftGeomUtils clean up imports, and Python 2 compatibility
Small spacing fixes like imports in separate lines
for more clarity, and the position of the license.

Also fix copying of a list in order to keep compatibility
with Python 2.
2020-04-07 18:12:06 +02:00
luz.paz
c8cb520887 [skip ci] fix follow-up typos 2020-03-06 14:50:35 +01:00
luz.paz
ebe194a9e9 Fix typos
Found via  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-03-06 14:50:35 +01:00
paullee0
f77a6949c9 [ArchWall, DraftGeomUtils] fix bug: ArchWall with Offset Attribute set and based on Sketch fails at some cases
DraftGeomUtils.offsetWire() supports ArchWall Offset setting inherently now.

Discussion:
https://forum.freecadweb.org/viewtopic.php?f=23&t=42933
2020-02-10 11:19:47 +01:00
paullee0
0f38aad7ba [DraftGeomUtils] OffsetWire() to accept input as Face as previously did.
Forum Discussion -
https://forum.freecadweb.org/viewtopic.php?f=23&t=42282&p=359233#p359233
2020-01-10 10:08:00 +01:00