OpenScad import: Unsupported Function r....
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
OpenScad import: Unsupported Function r....
Hi all. First post.
In trying to open an OpenScad file I get a small dialog box saying "Unsported Function: r..." but have no idea how to read the full text of the error.
Also, is there a list of unsupported OpenScad functions somewhere?
In trying to open an OpenScad file I get a small dialog box saying "Unsported Function: r..." but have no idea how to read the full text of the error.
Also, is there a list of unsupported OpenScad functions somewhere?
Re: OpenScad import: Unsupported Function r....
Hi @Aimsport, welcome to the forum.
Could you please follow the instructions in the big red box above your post to include all the info that could help people out?
Version information and sample files that show the problem help us help you.
Could you please follow the instructions in the big red box above your post to include all the info that could help people out?
Version information and sample files that show the problem help us help you.
Re: OpenScad import: Unsupported Function r....
Hi Aimsport and welcome from me as well. The following links should get you started:
Per Agryson and because it is customary here:
viewtopic.php?f=3&t=2264
OpenSCAD specific links:
http://freecadweb.org/wiki/Import_OpenSCAD_code
http://freecadweb.org/wiki/index.php?ti ... CAD_Module
(OpenSCAD itself needs to be installed separately because it's not included in FreeCAD)
Per Agryson and because it is customary here:
viewtopic.php?f=3&t=2264
OpenSCAD specific links:
http://freecadweb.org/wiki/Import_OpenSCAD_code
http://freecadweb.org/wiki/index.php?ti ... CAD_Module
(OpenSCAD itself needs to be installed separately because it's not included in FreeCAD)
Re: OpenScad import: Unsupported Function r....
Sorry, I forgot to answer this:
Next go to Edit > Preferences > General (icon in left pane) > Output Window (tab in right pane) and change the tick-boxes like so:
Try View (pull-down menu) > Panels and tick Report View and Python Console to True.Aimsport wrote:In trying to open an OpenScad file I get a small dialog box saying "Unsported Function: r..." but have no idea how to read the full text of the error.
Next go to Edit > Preferences > General (icon in left pane) > Output Window (tab in right pane) and change the tick-boxes like so:
Re: OpenScad import: Unsupported Function r....
Similar bug using latest FC master:
"Unsupported Function: projection"
Code to test it out:
Error message in console:
"Unsupported Function: projection"
Code to test it out:
Code: Select all
hull () {
linear_extrude (height=1, center=true){
projection (cut = false) {
mirror ([1, 0, 0]) {
mirror ([0, 1, 0]) {
cylinder (h=2, r=20, center=true);
}
}
}
}
}
Linear Extrude With Twist
('Twist : ', {'scale': [1.0, 1.0], 'center': 'true', '$fs': '2', 'height': '1', '$fn': '0', '$fa': '12', 'convexity': '1'})
Traceback (most recent call last):
File "/opt/freecad/Mod/OpenSCAD/OpenSCADCommands.py", line 305, in addelement
importCSG.insert(tmpfilename,doc.Name)
File "/opt/freecad/Mod/OpenSCAD/importCSG.py", line 121, in insert
processcsg(filename)
File "/opt/freecad/Mod/OpenSCAD/importCSG.py", line 145, in processcsg
result = parser.parse(f.read())
File "/opt/freecad/Mod/OpenSCAD/ply/yacc.py", line 265, in parse
return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
File "/opt/freecad/Mod/OpenSCAD/ply/yacc.py", line 971, in parseopt_notrack
p.callable(pslice)
File "/opt/freecad/Mod/OpenSCAD/importCSG.py", line 657, in p_linear_extrude_with_twist
if (len(p[6]) == 0) :
TypeError: object of type 'NoneType' has no len()
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: OpenScad import: Unsupported Function r....
projection with cut = false is not supported.
see line 1197 onwards in importCSG.py i.e.
The error in Linear Extrude With Twist occurs because the projection does not return anything to the object stack.
I do not recognise the code for handling projection, so I assume its something that shoogen added.
The following OpenSCAD operations are not support, there may be others
see line 1197 onwards in importCSG.py i.e.
Code: Select all
else: # cut == 'false' => true projection^M
1198 if gui and not FreeCAD.ParamGet("User parameter:BaseApp/Preferences /Mod/OpenSCAD").\^M
1199 GetBool('usePlaceholderForUnsupported'):^M
1200 from PySide import QtGui^M
1201 QtGui.QMessageBox.critical(None, unicode(translate('OpenSCAD'," Unsupported Function"))+" : "+p[1],unicode(translate('OpenSCAD',"Press OK") ))^M
I do not recognise the code for handling projection, so I assume its something that shoogen added.
The following OpenSCAD operations are not support, there may be others
- glide
resize
subdiv
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: OpenScad import: Unsupported Function r....
If Aimsport and others want support for resize then somebody should raise a request in the FreeCAD Tracker to support a Toposhape resize request in the FreeCAD API, then resize could be added as a supported function to OpenSCAD. A Toposhape resize should be possible as OCC seems to support a resizing operation see https://www.opencascade.com/content/resizing-shape
Update: Just rechecked the FreeCAD docs and FreeCAD Toposhape does support transformShape ( matrix ). I will try and find some time to look at adding support for the OpenSCAD resize request.
Update: Just rechecked the FreeCAD docs and FreeCAD Toposhape does support transformShape ( matrix ). I will try and find some time to look at adding support for the OpenSCAD resize request.
Re: OpenScad import: Unsupported Function r....
Next time I will look into the script before I ask.
Do you know a workaround so I can use "projection(cut = false)"? Maybe a freecad function?
I can't use other commands, as the OpenScad code is generated by another piece of code I can't edit.
Somehow I have to deal with the "cut = false".
Do you know a workaround so I can use "projection(cut = false)"? Maybe a freecad function?
I can't use other commands, as the OpenScad code is generated by another piece of code I can't edit.
Somehow I have to deal with the "cut = false".
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: OpenScad import: Unsupported Function r....
projection ( cut = true) adds a plane to an object's shape. If somebody can suggest a way of performing a projection ( cut = false ) then I would look at updating ImportCSG.py.
i.e. At the time of the projection request ImportCSG.py has the relevant object on a stack and access to the matrix and needs to perform the projection request using the FreeCAD API returning an object.
i.e. At the time of the projection request ImportCSG.py has the relevant object on a stack and access to the matrix and needs to perform the projection request using the FreeCAD API returning an object.
Re: OpenScad import: Unsupported Function r....
Hi @keithsloan52, did anything ever come of this? I see that the resize() code in importCSG is still calling Draft.resize(), so doesn't actually do anything to 3D geometry.keithsloan52 wrote: ↑Sat Oct 07, 2017 8:18 pm Update: Just rechecked the FreeCAD docs and FreeCAD Toposhape does support transformShape ( matrix ). I will try and find some time to look at adding support for the OpenSCAD resize request.