I defined a shape of wire and a shape of face.
I want to get the shape by using makePipe.
But the final shape is weird.What's wrong with it?
The shape generated by makepipe is weird.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
The shape generated by makepipe is weird.
- Attachments
-
- LineAndArea.png (2.78 KiB) Viewed 760 times
-
- finalShape.png (2.11 KiB) Viewed 760 times
Re: The shape generated by makepipe is weird.
No FreeCAD info, no file attached, no exact step by step description - how can we help? Perhaps you can try to find a solution here: http://cdn2.spiegel.de/images/image-730 ... -73031.jpg
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: The shape generated by makepipe is weird.
Sorry, it's my fault. I just posted my code.chrisb wrote: ↑Sat May 25, 2019 8:00 am No FreeCAD info, no file attached, no exact step by step description - how can we help? Perhaps you can try to find a solution here: http://cdn2.spiegel.de/images/image-730 ... -73031.jpg
Code: Select all
class ConformalArea:
def __init__(self, obj):
obj.addProperty("App::PropertyVectorDistance", "Point1", "Object of a ConformalArea",
"Point1 of the ConformalArea").Point1 = FreeCAD.Vector(0.86, 0.5, 0)
obj.addProperty("App::PropertyVectorDistance", "Point2", "Object of a ConformalArea",
"Point2 of the ConformalArea").Point2 = FreeCAD.Vector(0.86, 0.5, 2)
obj.addProperty("App::PropertyAngle", "starAngle", "", "").starAngle = 30
obj.addProperty("App::PropertyAngle", "endAngle", "", "").endAngle = 90
obj.addProperty("App::PropertyFloat","Radius","","").Radius = 1
obj.Proxy = self
def execute(self, fp):
line = Part.makeLine(fp.Point1, fp.Point2)
linePath = Part.makeCircle(fp.Radius + 0.001, FreeCAD.Vector(0, 0, fp.Point2.z), FreeCAD.Vector(0, 0, 1),
fp.starAngle, fp.endAngle)
path = Part.Wire(linePath)
fp.Shape = path.makePipe(line)
class Line:
def __init__(self,obj):
obj.addProperty("App::PropertyVectorDistance", "Point1", "Object of a ConformalLine","Point1 of the ConformalLine").Point1 = FreeCAD.Vector(0.86, 0.5, 0)
obj.addProperty("App::PropertyVectorDistance", "Point2", "Object of a ConformalLine","Point2 of the ConformalLine").Point2 = FreeCAD.Vector(1.7, 1, 0)
#obj.addProperty("App::PropertyVectorDistance", "Point1", "Object of a ConformalLine","Point1 of the ConformalLine").Point1 = FreeCAD.Vector(0, 0.5, 0)
#obj.addProperty("App::PropertyVectorDistance", "Point2", "Object of a ConformalLine","Point2 of the ConformalLine").Point2 = FreeCAD.Vector(2, 1, 0)
obj.Proxy = self
def execute(self, fp):
fp.Shape=Part.makeLine(fp.Point1,fp.Point2)
obj1 = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","ConformalArea")
ConformalArea(obj1)
obj1.ViewObject.Proxy=0
FreeCAD.ActiveDocument.recompute()
obj2 = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Line")
Line(obj2)
obj2.ViewObject.Proxy=0
FreeCAD.ActiveDocument.recompute()
path=Part.Wire(obj2.Shape)
obj=path.makePipe(obj1.Shape)
Part.show(obj)
- Attachments
-
- MyShape.png (8.64 KiB) Viewed 699 times
Re: The shape generated by makepipe is weird.
At the end of your script :
Here, obj1.Shape is a shell.
You should explicitly use a wire or an edge:
Code: Select all
obj=path.makePipe(obj1.Shape)
You should explicitly use a wire or an edge:
Code: Select all
obj=path.makePipe(obj1.Shape.Wires[0])
Re: The shape generated by makepipe is weird.
Thank you very much.It is normal.But why is this shape not closed?Chris_G wrote: ↑Mon May 27, 2019 12:54 pm At the end of your script :Here, obj1.Shape is a shell.Code: Select all
obj=path.makePipe(obj1.Shape)
You should explicitly use a wire or an edge:Code: Select all
obj=path.makePipe(obj1.Shape.Wires[0])
- Attachments
-
- Shape.png (1.89 KiB) Viewed 673 times
Re: The shape generated by makepipe is weird.
When I use the makePipeShell function, why are some models closed and some models not closed?JOE_FU wrote: ↑Mon May 27, 2019 1:05 pmThank you very much.It is normal.But why is this shape not closed?Chris_G wrote: ↑Mon May 27, 2019 12:54 pm At the end of your script :Here, obj1.Shape is a shell.Code: Select all
obj=path.makePipe(obj1.Shape)
You should explicitly use a wire or an edge:Code: Select all
obj=path.makePipe(obj1.Shape.Wires[0])