Comments (2)
Create a sketch with this code snippet:
doc = App.newDocument()
body = doc.addObject('PartDesign::Body','Body')
sketch = body.newObject('Sketcher::SketchObject','Sketch')
sketch.AttachmentSupport = (doc.getObject('XY_Plane'),[''])
sketch.MapMode = 'FlatFace'
geoList = []
geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-66.131020, -10.357095, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 3.409007), 4.279981, 7.507065))
geoList.append(Part.LineSegment(App.Vector(-76.131020, 7.380997, 0.000000), App.Vector(-77.321495, -31.666620, 0.000000)))
sketch.addGeometry(geoList, False)
del geoList
sketch.addConstraint(Sketcher.Constraint('Vertical', 1))
sketch.addConstraint(Sketcher.Constraint('Distance',0,1,1,8.571427))
sketch.setDatum(1,App.Units.Quantity('8.571430 mm'))
doc.recompute()
Edit the sketch and do a fit all if needed. Trying to move the datum constraint causes totally un-intuitive behaviour. Moving the mouse to up or down moves the label to left or right. Moving the mouse to right or light moves the label to bottom or top.
Furthermore the helper circle is confusing and doesn't add any valuable information.
from freecad.
Second example:
doc = App.newDocument()
body = doc.addObject('PartDesign::Body','Body')
sketch = body.newObject('Sketcher::SketchObject','Sketch')
sketch.AttachmentSupport = (doc.getObject('XY_Plane'),[''])
sketch.MapMode = 'FlatFace'
geoList = []
geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-44.226295, 6.428696, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 21.102344), 1.058407, 3.648143))
geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(-26.250109, -12.261777, 0.000000), App.Vector(0.000000, 0.000000, 1.000000), 7.622766), 4.037648, 6.851029))
sketch.addGeometry(geoList,False)
del geoList
sketch.addConstraint(Sketcher.Constraint('Distance',0,3,1,18.309396))
sketch.setDatum(0,App.Units.Quantity('18.309400 mm'))
doc.recompute()
This adds a distance constraint between the center point of the big circle and the shape of the small circle. Showing the helper circle for the small one is OK but I don't think the helper circle of the big one is anyhow helpful because the constraint reference a point of this circle and not its shape.
from freecad.
Related Issues (20)
- Subtractive helix looks like not working or the model is not regenerated after the feature HOT 4
- Missing buttons from task panel HOT 3
- Build error, missing .h file HOT 1
- Sketcher/Polyline needs 2 RMB clicks to exit after drawing a closed shape
- Sketcher/Dimension tool is exited if RMB click during constraint creation
- Redundance constraints as an opportunity to fix the sketch FLIP.
- Limit values that lead to an error. HOT 4
- Sketcher Symmetry tool duplicates constraint labels HOT 1
- Part Design UI - NewSketch Plane attachment/orientation selection widget issue HOT 2
- toolbar inaccessible outside screen HOT 6
- [Sketcher] Automatic constraint for polyline on external plane reference always results in symmetric constraint HOT 2
- Draft: cancelling the Split command with Esc results in unhandled exception HOT 1
- Draft: cannot create centered rectangle directly
- Assembly: grounded joint doesnโt fully highlight
- Sketcher: arc length higher than half diameter looks bad HOT 2
- Materials: Source for Mechanical properties of Wood HOT 7
- improvement of the "hide" function HOT 2
- creating 2d documents from 3d
- Assembly: wrong mating of cones HOT 4
- [Problem] Pocket with "Start At Center" still starting from Edge HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freecad.