Comments (2)
@bgbsww FYI
from freecad.
During the process of turning this into a test I didn't see the problem. But when I ran the test I definitely did.
If you turn the sketch visibility on, you can see that it isn't against the second box anymore. I suspect this is because of a failure to correctly apply the placement of that second box. Investigating as to why shows that the change to Box001 changed Face2 into Face9, and that wasn't updated in the Sketch.AttachmentSupport. That's a TNP error for sure. So, why isn't AttachmentSupport getting updated correctly. TBD.
Here's the test:
def testSomething(self):
doc = App.ActiveDocument
doc.addObject("Part::Box","Box")
doc.ActiveObject.Label = "Cube"
doc.addObject("Part::Box","Box")
doc.ActiveObject.Label = "Cube"
from BOPTools import BOPFeatures
bp = BOPFeatures.BOPFeatures(App.activeDocument())
bp.make_multi_fuse(["Box", "Box001", ])
App.activeDocument().addObject('PartDesign::Body','Body')
doc.Body.Label = 'Body'
App.activeDocument().Body.BaseFeature = App.activeDocument().Fusion
doc.Body.newObject('Sketcher::SketchObject','Sketch')
doc.Sketch.AttachmentSupport = (doc.BaseFeature,['Face2',])
doc.Sketch.MapMode = 'FlatFace'
geoList = []
geoList.append(Part.LineSegment(App.Vector(11.562587, 13.382092, 0.000000),App.Vector(11.562587, 10.644792, 0.000000)))
geoList.append(Part.LineSegment(App.Vector(11.562587, 10.644792, 0.000000),App.Vector(14.063914, 10.644792, 0.000000)))
geoList.append(Part.LineSegment(App.Vector(14.063914, 10.644792, 0.000000),App.Vector(14.063914, 13.382092, 0.000000)))
geoList.append(Part.LineSegment(App.Vector(14.063914, 13.382092, 0.000000),App.Vector(11.562587, 13.382092, 0.000000)))
doc.Sketch.addGeometry(geoList,False)
del geoList
constraintList = []
constraintList.append(Sketcher.Constraint('Coincident', 0, 2, 1, 1))
constraintList.append(Sketcher.Constraint('Coincident', 1, 2, 2, 1))
constraintList.append(Sketcher.Constraint('Coincident', 2, 2, 3, 1))
constraintList.append(Sketcher.Constraint('Coincident', 3, 2, 0, 1))
constraintList.append(Sketcher.Constraint('Vertical', 0))
constraintList.append(Sketcher.Constraint('Vertical', 2))
constraintList.append(Sketcher.Constraint('Horizontal', 1))
constraintList.append(Sketcher.Constraint('Horizontal', 3))
doc.Sketch.addConstraint(constraintList)
del constraintList
constraintList = []
doc.recompute()
doc.recompute()
doc.Body.newObject('PartDesign::Pad','Pad')
doc.Pad.Profile = (doc.Sketch, ['',])
doc.Pad.Length = 10
doc.recompute()
doc.Pad.ReferenceAxis = (doc.Sketch,['N_Axis'])
doc.Sketch.Visibility = False
doc.Pad.Length = 10.000000
doc.Pad.TaperAngle = 0.000000
doc.Pad.UseCustomVector = 0
doc.Pad.Direction = (0, -1, 0)
doc.Pad.ReferenceAxis = (doc.Sketch, ['N_Axis'])
doc.Pad.AlongSketchNormal = 1
doc.Pad.Type = 0
doc.Pad.UpToFace = None
doc.Pad.Reversed = 0
doc.Pad.Midplane = 0
doc.Pad.Offset = 0
doc.BaseFeature.Visibility = False
doc.Sketch.Visibility = False
# Act
App.getDocument("Unnamed").Box001.Width='3.00 mm'
App.getDocument("Unnamed").Box001.Height='10.00 mm'
App.getDocument("Unnamed").Box001.Placement=App.Placement(App.Vector(5.00,5.00,5.00),App.Rotation(App.Vector(0.00,0.00,1.00),0.00))
doc.recompute()
from freecad.
Related Issues (20)
- Sketcher selection box barely visible in Light theme HOT 6
- Tool is not selected in the toolbar after clicking HOT 2
- "Undo" doesn't work properly for external geometry creation HOT 4
- Cannot find Polar transform in sketcher workbench HOT 1
- TechDraw: No default page template HOT 4
- Cannot change Shape Appearance HOT 1
- task overlay interferes with spreadsheet HOT 1
- No visual cue to help selecting a point in model view HOT 5
- Change a position of the dimentions popul (Length, etc)
- Importing SVG (produced by InkScape) fails with "ordinal not in range(128)" HOT 5
- Part Workbench: Create sketch from three points, origin unrelated to any of the points HOT 3
- Suppressing geometry triggers TNP HOT 1
- After recent upgrade of Qt6 and python3.12 on Archlinux, Draft and Arch WB get errors. HOT 4
- STEP Export going wrong HOT 2
- Arch Wall Alignments using implict Sketcher Direction Constraints HOT 1
- Addon manager causes temporary ban from github (ratelimit) HOT 8
- Locale defaults to "C" on Mac, rather than utf-8, triggers bugs HOT 3
- "New File" option buttons on Welcome Screen shrink when theme is selected HOT 1
- PartDesign::Thickness fails on more complex solids with "unknown exception" HOT 1
- Problem : Expression editor doesn't recognize tab character for selection completion HOT 1
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.