File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
src/compas/robots/resources Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ def can_load_mesh(self, url):
8282 Otherwise ``False``.
8383 """
8484
85- url = self ._get_local_path (url )
85+ url = self ._get_local_url (url )
8686 scheme = urlparse (url ).scheme
8787
8888 # Local files have either:
@@ -111,15 +111,13 @@ def load_mesh(self, url):
111111 -------
112112 :class:`Mesh`
113113 Instance of a mesh.
114- """
115- # if url.startswith('file:///'):
116- # url = url[8:]
117-
118- url = self ._get_local_path (url )
114+ """
115+ url = self ._get_local_url (url )
119116 return _mesh_import (url , url )
120117
121- def _get_local_path (self , url ):
118+ def _get_local_url (self , url ):
122119 """Concatenates basepath directory to URL only if defined in the keyword arguments.
120+ It also strips out the scheme 'file:///' from the URL if present.
123121
124122 Parameters
125123 ----------
@@ -130,15 +128,14 @@ def _get_local_path(self, url):
130128 -------
131129 url: str
132130 Extended mesh location if basepath in kwargs.
133- Else, it returns None .
131+ Else, it returns url .
134132 """
135133 if url .startswith ('file:///' ):
136134 url = url [8 :]
137135
138136 basepath = self .attr .get ('basepath' )
139137 if basepath :
140138 return os .path .join (basepath , url )
141-
142139 return url
143140
144141
You can’t perform that action at this time.
0 commit comments